Discussion:
Comments in TSO commands
(too old to reply)
Bob Bridges
2017-07-05 20:45:04 UTC
Permalink
Here's an odd one I just encountered - not to do with REXX itself but rather with the way TSO itself handles comments in TSO commands.

According to the TSO Command Reference (see http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/1.2.2), you can include comments in a TSO command, like this for example:

tso help xmit /* this is a comment

You can close the comment with "*/", but if there's nothing else on the line you don’t have to. Ok, I knew that; I use it often when writing a REXX that puts commands into a PDS so that I can examine the commands before executing them.

Here's the surprise: Since everything after "/*" in a TSO command is a comment, I assumed that the TSO command parser would omit the comment when passing the arguments on to whatever command is being executed. For example, if in a CLIST appears this:

TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY

...I supposed that what the TSS command would see is "ADD(DWHIT12) PROF(PROF1234)", with the comment stripped out. Otherwise, ~every~ command that is ever called by TSO would have to know what to do with "/*".

And apparently every command does. I just wrote a quick REXX to say the arguments. When I call it from the READY prompt it shows the whole command line including the comment:

X arg /* more args
ARG /* MORE ARGS
READY

When I execute it from ISPF it's even weirder:

Command ===> tso x arg /* more args
ARG /* MORE ARGS)
***

ISPF is apparently adding a right paren to the command. But it doesn't do that when I close the comment:

Command ===> tso x arg /* more args */
ARG /* MORE ARGS */
***

This is not at all what I expected, and I don't understand the rationale for it. Is it documented anywhere?

---
Bob Bridges
***@gmail.com, cell 336 382-7313
***@InfoSecInc.com

/* If you refuse to accept anything but the best you often get it. -unknown
The rest of the time you get nothing. The really good trick is knowing when you should settle. -Bob Bridges */

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2017-07-07 12:41:08 UTC
Permalink
On 2017-07-05, at 14:45, Bob Bridges wrote:

> Here's an odd one I just encountered - not to do with REXX itself but rather with the way TSO itself handles comments in TSO commands.
>
> According to the TSO Command Reference (see http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/1.2.2), you can include comments in a TSO command, like this for example:
>
> tso help xmit /* this is a comment
>
> You can close the comment with "*/", but if there's nothing else on the line you don’t have to. Ok, I knew that; I use it often when writing a REXX that puts commands into a PDS so that I can examine the commands before executing them.
>
> Here's the surprise: Since everything after "/*" in a TSO command is a comment, I assumed that the TSO command parser would omit the comment when passing the arguments on to whatever command is being executed. For example, if in a CLIST appears this:
>
> TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY
>
> ...I supposed that what the TSS command would see is "ADD(DWHIT12) PROF(PROF1234)", with the comment stripped out. Otherwise, ~every~ command that is ever called by TSO would have to know what to do with "/*".
>
> And apparently every command does. I just wrote a quick REXX to say the arguments. When I call it from the READY prompt it shows the whole command line including the comment:
>
I wouldn't expect "every command" to do that, but the parser to do
it so the command itself never sees the comment.

> X arg /* more args
> ARG /* MORE ARGS
> READY
>
> When I execute it from ISPF it's even weirder:
>
> Command ===> tso x arg /* more args
> ARG /* MORE ARGS)
> ***
>
> ISPF is apparently adding a right paren to the command. But it doesn't do that when I close the comment:
>
> Command ===> tso x arg /* more args */
> ARG /* MORE ARGS */
> ***
>
Can you post the Rexx code itself, verbatim, so we can understand better?
Add a "trace R" at the beginning so we can see what Rexx does, and post
the result.

> This is not at all what I expected, and I don't understand the rationale for it. Is it documented anywhere?

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
James Campbell
2017-07-08 10:13:20 UTC
Permalink
Where you are getting confused is that the parser runs as a subroutine of the command
processor (unless you want to do it yourself).

So the command processor does see the comment (in the command string) and the parser
does hide the comment from the command - because there is nowhere in the syntax
structure for the comment (or comments) to be handed back to the command.

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ikjb700/ch
parse.htm

James Campbell

On 7 Jul 2017 at 6:42, Paul Gilmartin wrote:

> On 2017-07-05, at 14:45, Bob Bridges wrote:
>
> > Here's an odd one I just encountered - not to do with REXX itself but rather with the way TSO itself handles comments in TSO commands.
> >
> > According to the TSO Command Reference (see http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/1.2.2), you can include comments in a TSO command, like this for example:
> >
> > tso help xmit /* this is a comment
> >
> > You can close the comment with "*/", but if there's nothing else on the line you don´t have to. Ok, I knew that; I use it often when writing a REXX that puts commands into a PDS so that I can examine the commands before executing them.
> >
> > Here's the surprise: Since everything after "/*" in a TSO command is a comment, I assumed that the TSO command parser would omit the comment when passing the arguments on to whatever command is being executed. For example, if in a CLIST appears this:
> >
> > TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY
> >
> > ...I supposed that what the TSS command would see is "ADD(DWHIT12) PROF(PROF1234)", with the comment stripped out. Otherwise, ~every~ command that is ever called by TSO would have to know what to do with "/*".
> >
> > And apparently every command does. I just wrote a quick REXX to say the arguments. When I call it from the READY prompt it shows the whole command line including the comment:
> >
> I wouldn't expect "every command" to do that, but the parser to do
> it so the command itself never sees the comment.
>
> > X arg /* more args
> > ARG /* MORE ARGS
> > READY
> >
> > When I execute it from ISPF it's even weirder:
> >
> > Command ===> tso x arg /* more args
> > ARG /* MORE ARGS)
> > ***
> >
> > ISPF is apparently adding a right paren to the command. But it doesn't do that when I close the comment:
> >
> > Command ===> tso x arg /* more args */
> > ARG /* MORE ARGS */
> > ***
> >
> Can you post the Rexx code itself, verbatim, so we can understand better?
> Add a "trace R" at the beginning so we can see what Rexx does, and post
> the result.
>
> > This is not at all what I expected, and I don't understand the rationale for it. Is it documented anywhere?
>
> -- gil
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Bob Bridges
2017-07-09 23:48:00 UTC
Permalink
Unless I misunderstood you, what I wrote below proves that the parser does
~not~ hide the comment from the command. Take another look: When I invoke
a TSS command with a "/* COMMENT", the comment is seen (and improperly
handled) by the TSS command. When I write a REXX command and then invoke
it, the comment is seen by the REXX command. The TSO parser is not
stripping the comment from the command; the command sees it and therefore
must process it.

---
Bob Bridges
***@gmail.com, cell 336 382-7313
***@InfoSecInc.com

/* Sometimes patriotism means defending your country against its government.
-Edward Abbey */


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
James Campbell
Sent: Saturday, July 8, 2017 01:29

Where you are getting confused is that the parser runs as a subroutine of
the command processor (unless you want to do it yourself).

So the command processor does see the comment (in the command string) and
the parser does hide the comment from the command - because there is nowhere
in the syntax structure for the comment (or comments) to be handed back to
the command.

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ik
jb700/chparse.htm

--- On 7 Jul 2017 at 6:42, Paul Gilmartin wrote:

> --- On 2017-07-05, at 14:45, Bob Bridges wrote:
> > Here's an odd one I just encountered - not to do with REXX itself but
rather with the way TSO itself handles comments in TSO
> > commands.
> >
> > According to the TSO Command Reference (see
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/1.2.2),
you can
> > include comments in a TSO command, like this for example:
> >
> > tso help xmit /* this is a comment
> >
> > You can close the comment with "*/", but if there's nothing else on the
line you don´t have to. Ok, I knew that; I use it often
> > when writing a REXX that puts commands into a PDS so that I can examine
the commands before executing them.
> >
> > Here's the surprise: Since everything after "/*" in a TSO command is a
comment, I assumed that the TSO command parser would omit
> > the comment when passing the arguments on to whatever command is being
executed. For example, if in a CLIST appears this:
> >
> > TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY
> >
> > ...I supposed that what the TSS command would see is "ADD(DWHIT12)
PROF(PROF1234)", with the comment stripped out. Otherwise,
> > ~every~ command that is ever called by TSO would have to know what to do
with "/*".
> >
> > And apparently every command does. I just wrote a quick REXX to say the
arguments. When I call it from the READY prompt it shows
> > the whole command line including the comment:
> >
> I wouldn't expect "every command" to do that, but the parser to do it
> so the command itself never sees the comment.
>
> > X arg /* more args
> > ARG /* MORE ARGS
> > READY
> >
> > When I execute it from ISPF it's even weirder:
> >
> > Command ===> tso x arg /* more args ARG /* MORE ARGS)
> > ***
> >
> > ISPF is apparently adding a right paren to the command. But it doesn't
do that when I close the comment:
> >
> > Command ===> tso x arg /* more args */ ARG /* MORE ARGS */
> > ***
> >
> Can you post the Rexx code itself, verbatim, so we can understand better?
> Add a "trace R" at the beginning so we can see what Rexx does, and
> post the result.
>
> > This is not at all what I expected, and I don't understand the rationale
for it. Is it documented anywhere?

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Jeremy Nicoll
2017-07-10 09:44:30 UTC
Permalink
On Mon, 10 Jul 2017, at 00:48, Bob Bridges wrote:
> Unless I misunderstood you, what I wrote below proves that the parser
> does ~not~ hide the comment from the command.

You must have misunderstood, for that's what James Campbell said.

But, you talk about "the parser" as if its functioning is going to be
the same for
all TSO command processors. It's not. It depends entirely on how (and
indeed,
if) the coder of the command processor chose to use IKJPARS. There's
also the
chance that they set that up and call it then don't properly use the
parsed values
it returns.

(I think you're assuming the parsing happens when TSO reads the command
line,
before it calls the command processor that supports the command
concerned.)

So, you're comparing the way the author of the TSS command processor
chose to
use IKJPARS, versus the way that IBM wrote eg the EXEC command
processor.

--
Jeremy Nicoll - my opinions are my own.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
James Campbell
2017-07-11 11:49:34 UTC
Permalink
OK, the output structures used by the parser do not include anywhere into which to the put
the parsed comment. So it hides the comment from its parsed output.

Since the parser does not alter the command text passed to it (which was, presumably,
passed to the command processor) it would, of course, be impossible for the parser to hide
anything from the command processor.

Does that make you happier?

James Campbell


On 9 Jul 2017 at 19:48, Bob Bridges wrote:

> Unless I misunderstood you, what I wrote below proves that the parser does
> ~not~ hide the comment from the command. Take another look: When I invoke
> a TSS command with a "/* COMMENT", the comment is seen (and improperly
> handled) by the TSS command. When I write a REXX command and then invoke
> it, the comment is seen by the REXX command. The TSO parser is not
> stripping the comment from the command; the command sees it and therefore
> must process it.
>
> ---
> Bob Bridges
> ***@gmail.com, cell 336 382-7313
> ***@InfoSecInc.com
>
> /* Sometimes patriotism means defending your country against its government.
> -Edward Abbey */
>
>
> -----Original Message-----
> From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
> James Campbell
> Sent: Saturday, July 8, 2017 01:29
>
> Where you are getting confused is that the parser runs as a subroutine of
> the command processor (unless you want to do it yourself).
>
> So the command processor does see the comment (in the command string) and
> the parser does hide the comment from the command - because there is nowhere
> in the syntax structure for the comment (or comments) to be handed back to
> the command.
>
> https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ik
> jb700/chparse.htm
>
> --- On 7 Jul 2017 at 6:42, Paul Gilmartin wrote:
>
> > --- On 2017-07-05, at 14:45, Bob Bridges wrote:
> > > Here's an odd one I just encountered - not to do with REXX itself but
> rather with the way TSO itself handles comments in TSO
> > > commands.
> > >
> > > According to the TSO Command Reference (see
> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/1.2.2),
> you can
> > > include comments in a TSO command, like this for example:
> > >
> > > tso help xmit /* this is a comment
> > >
> > > You can close the comment with "*/", but if there's nothing else on the
> line you don´t have to. Ok, I knew that; I use it often
> > > when writing a REXX that puts commands into a PDS so that I can examine
> the commands before executing them.
> > >
> > > Here's the surprise: Since everything after "/*" in a TSO command is a
> comment, I assumed that the TSO command parser would omit
> > > the comment when passing the arguments on to whatever command is being
> executed. For example, if in a CLIST appears this:
> > >
> > > TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY
> > >
> > > ...I supposed that what the TSS command would see is "ADD(DWHIT12)
> PROF(PROF1234)", with the comment stripped out. Otherwise,
> > > ~every~ command that is ever called by TSO would have to know what to do
> with "/*".
> > >
> > > And apparently every command does. I just wrote a quick REXX to say the
> arguments. When I call it from the READY prompt it shows
> > > the whole command line including the comment:
> > >
> > I wouldn't expect "every command" to do that, but the parser to do it
> > so the command itself never sees the comment.
> >
> > > X arg /* more args
> > > ARG /* MORE ARGS
> > > READY
> > >
> > > When I execute it from ISPF it's even weirder:
> > >
> > > Command ===> tso x arg /* more args ARG /* MORE ARGS)
> > > ***
> > >
> > > ISPF is apparently adding a right paren to the command. But it doesn't
> do that when I close the comment:
> > >
> > > Command ===> tso x arg /* more args */ ARG /* MORE ARGS */
> > > ***
> > >
> > Can you post the Rexx code itself, verbatim, so we can understand better?
> > Add a "trace R" at the beginning so we can see what Rexx does, and
> > post the result.
> >
> > > This is not at all what I expected, and I don't understand the rationale
> for it. Is it documented anywhere?
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Bob Bridges
2017-07-11 17:27:01 UTC
Permalink
If it seemed to you that I was picking at terminology, then it must be that
I'm mistaken in some fundamental assumption. But I don't know which one
yet. Here's what I believe about the way TSO works - or believed until just
before I started this thread:

1) I type a command. Let's assume I'm doing this at the READY prompt, so as
to avoid the complication of ISPF improperly adding that right parenthesis.
The command, let's say, is "REXXMOD ARG1 ARG2 /* COMMENT".

2) TSO parses this string: It spots "REXXMOD" as the command name, "/*
COMMENT" as a comment, and that leaves "ARG1 ARG2" as the argument string.

3) TSO searches for REXXMOD in a concatenation of compiled programs, and
fails to find it.

4) TSO searches for REXXMOD in the SYSPROC concatenation, and (let's say)
finds it there.

5) TSO puts "ARG1 ARG2" in the arg list and fires up REXXMOD using the CLIST
interpreter

6) The CLIST interpreter notices "REXX" in a first-line comment and shuffles
off the whole chore to the REXX interpreter.

7) The REXX interpreter finds "ARG1 ARG2" in the argument list.

But I've seen that "/* COMMENT" appears in the arg list to my REXX, so
clearly the above is wrong; and because of you good folks I now know there's
something called IKJPARS. But I haven't found yet in the IKJPARS
documentation any mention of handling comments, and the TSO Command Ref
(section 1.2.2) clearly states that ~any~ TSO/E command can have a comment;
so it cannot be IKJPARS that handles comments.

...And now I'm right back to where I started; the documentation says "/*
something" in a TSO command is a comment, but it isn't so - it's passed as
argument text. I can see I'm misunderstanding something, but what?

---
Bob Bridges
***@gmail.com, cell 336 382-7313
***@InfoSecInc.com

/* Excellence is an art won by training and habituation. We do not act
rightly because we have virtue or excellence, but rather we have those
because we have acted rightly. We are what we repeatedly do. Excellence,
then, is not an act but a habit. -Aristotle */


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
James Campbell
Sent: Tuesday, July 11, 2017 07:51

OK, the output structures used by the parser do not include anywhere into
which to the put the parsed comment. So it hides the comment from its
parsed output.

Since the parser does not alter the command text passed to it (which was,
presumably, passed to the command processor) it would, of course, be
impossible for the parser to hide anything from the command processor.

Does that make you happier?


--- On 9 Jul 2017 at 19:48, Bob Bridges wrote:
> Unless I misunderstood you, what I wrote below proves that the parser
> does ~not~ hide the comment from the command. Take another look:
> When I invoke a TSS command with a "/* COMMENT", the comment is seen
> (and improperly handled) by the TSS command. When I write a REXX command
> and then invoke it, the comment is seen by the REXX command. The TSO
> parser is not stripping the comment from the command; the command sees it
> and therefore must process it.
>
>
> -----Original Message-----
> From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On
> Behalf Of James Campbell
> Sent: Saturday, July 8, 2017 01:29
>
> Where you are getting confused is that the parser runs as a subroutine
> of the command processor (unless you want to do it yourself).
>
> So the command processor does see the comment (in the command string)
> and the parser does hide the comment from the command - because there
> is nowhere in the syntax structure for the comment (or comments) to be
> handed back to the command.
>
> https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v
> 2r1.ikjb700/chparse.htm
>
> > --- On 2017-07-05, at 14:45, Bob Bridges wrote:
> > > Here's an odd one I just encountered - not to do with REXX itself
> > > but rather with the way TSO itself handles comments in TSOcommands.
> > >
> > > According to the TSO Command Reference (see
> > > http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/
> > > 1.2.2), you can include comments in a TSO command, like this for
> > > example:
> > >
> > > tso help xmit /* this is a comment
> > >
> > > You can close the comment with "*/", but if there's nothing else
> > > on the line you don´t have to. Ok, I knew that; I use it often
> > > when writing a REXX that puts commands into a PDS so that I can
> > > examine the commands before executing them.
> > >
> > > Here's the surprise: Since everything after "/*" in a TSO command
> > > is a comment, I assumed that the TSO command parser would omit
> > > the comment when passing the arguments on to whatever command is
> > > being executed. For example, if in a CLIST appears this:
> > >
> > > TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY
> > >
> > > ...I supposed that what the TSS command would see is "ADD(DWHIT12)
> > > PROF(PROF1234)", with the comment stripped out. Otherwise,
> > > ~every~ command that is ever called by TSO would have to know what
> > > to do with "/*".
> > >
> > > And apparently every command does. I just wrote a quick REXX to
> > > say the arguments. When I call it from the READY prompt it shows
> > > the whole command line including the comment:
> > >
> > > X arg /* more args
> > > ARG /* MORE ARGS
> > > READY
> > >
> > > When I execute it from ISPF it's even weirder:
> > >
> > > Command ===> tso x arg /* more args ARG /* MORE ARGS)
> > > ***
> > >
> > > ISPF is apparently adding a right paren to the command. But it
> > > doesn't do that when I close the comment:
> > >
> > > Command ===> tso x arg /* more args */ ARG /* MORE ARGS */
> > > ***

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Jeremy Nicoll
2017-07-11 17:42:35 UTC
Permalink
On Tue, 11 Jul 2017, at 18:27, Bob Bridges wrote:

> 1) I type a command. Let's assume I'm doing this at the READY prompt, so
> as
> to avoid the complication of ISPF improperly adding that right
> parenthesis.
> The command, let's say, is "REXXMOD ARG1 ARG2 /* COMMENT".
>
> 2) TSO parses this string: It spots "REXXMOD" as the command name, "/*
> COMMENT" as a comment, and that leaves "ARG1 ARG2" as the argument
> string.

NO.

I think it just looks at "REXXMOD". It fails to find that in
SYS1.CMDLIB (if that's
the place that TSO command processors live in - it's been so long since
I last
worked on a live system).

Then I think it must search SYSPROC and perhaps SYSEXEC to see if
there's a
matching clist or rexx exec.

If there isn't, you get a "command not found" sort of message.

If there is, tso calls the "EXEC" command processor and (I expect) gives
it then
entire character string, including slashes and asterisks and everything
else that
you typed.

Remember that: REXXMOD ARG1 ARG2 /* COMMENT

is just a shorthand for

EXEC 'SOME.WHERE.OR.OTHER(REXXMOD)' ARG1 ARG2 /* COMMENT

and it is the EXEC command processor that deal with all of that line, in
the same way
that

ALLOC FI(XYZ) DSN(....) ...

is dealt with entirely by the ALLOC command processor.


Everything after that depends on how IBM wrote the "EXEC" command
processor.
It's meant in due course either to invoke the rexx stuff or the clist
stuff, and I would
expect it to pass everything on to whichever language processor is
relevant.

/IF/ (I can't remember) there are any keyword or positional parms that
EXEC understands
apart from the datasetname of the code that's to be executed, then I'd
expect it to deal
with them.

--
Jeremy Nicoll - my opinions are my own.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
James Campbell
2017-07-11 22:45:15 UTC
Permalink
> 2) TSO parses this string: It spots "REXXMOD" as the command name, "/*
> COMMENT" as a comment, and that leaves "ARG1 ARG2" as the argument string.

No, "TSO" (actaully the Terminal Monitor Program - TMP) doesn't remove the comments.
They are left for the command processor to handle.

https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.ikjb600
/ikj2k200_The__CPPL_.htm

"Although parse recognizes comments present in the command buffer, it processes by
skipping over them. Comments, which are indicated by delimiter /* and */, are not removed
from the command buffer."

https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.2.0/com.ibm.zos.v2r2.ikjb600/ikj2k200_Using_the_.htm

Since a REXX program is given a copy of the unaltered command buffer, it has to handle
the comments.



James Campbell



On 11 Jul 2017 at 13:27, Bob Bridges wrote:

> If it seemed to you that I was picking at terminology, then it must be that
> I'm mistaken in some fundamental assumption. But I don't know which one
> yet. Here's what I believe about the way TSO works - or believed until just
> before I started this thread:
>
> 1) I type a command. Let's assume I'm doing this at the READY prompt, so as
> to avoid the complication of ISPF improperly adding that right parenthesis.
> The command, let's say, is "REXXMOD ARG1 ARG2 /* COMMENT".
>
> 2) TSO parses this string: It spots "REXXMOD" as the command name, "/*
> COMMENT" as a comment, and that leaves "ARG1 ARG2" as the argument string.
>
> 3) TSO searches for REXXMOD in a concatenation of compiled programs, and
> fails to find it.
>
> 4) TSO searches for REXXMOD in the SYSPROC concatenation, and (let's say)
> finds it there.
>
> 5) TSO puts "ARG1 ARG2" in the arg list and fires up REXXMOD using the CLIST
> interpreter
>
> 6) The CLIST interpreter notices "REXX" in a first-line comment and shuffles
> off the whole chore to the REXX interpreter.
>
> 7) The REXX interpreter finds "ARG1 ARG2" in the argument list.
>
> But I've seen that "/* COMMENT" appears in the arg list to my REXX, so
> clearly the above is wrong; and because of you good folks I now know there's
> something called IKJPARS. But I haven't found yet in the IKJPARS
> documentation any mention of handling comments, and the TSO Command Ref
> (section 1.2.2) clearly states that ~any~ TSO/E command can have a comment;
> so it cannot be IKJPARS that handles comments.
>
> ...And now I'm right back to where I started; the documentation says "/*
> something" in a TSO command is a comment, but it isn't so - it's passed as
> argument text. I can see I'm misunderstanding something, but what?
>
> ---
> Bob Bridges
> ***@gmail.com, cell 336 382-7313
> ***@InfoSecInc.com
>
> /* Excellence is an art won by training and habituation. We do not act
> rightly because we have virtue or excellence, but rather we have those
> because we have acted rightly. We are what we repeatedly do. Excellence,
> then, is not an act but a habit. -Aristotle */
>
>
> -----Original Message-----
> From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
> James Campbell
> Sent: Tuesday, July 11, 2017 07:51
>
> OK, the output structures used by the parser do not include anywhere into
> which to the put the parsed comment. So it hides the comment from its
> parsed output.
>
> Since the parser does not alter the command text passed to it (which was,
> presumably, passed to the command processor) it would, of course, be
> impossible for the parser to hide anything from the command processor.
>
> Does that make you happier?
>
>
> --- On 9 Jul 2017 at 19:48, Bob Bridges wrote:
> > Unless I misunderstood you, what I wrote below proves that the parser
> > does ~not~ hide the comment from the command. Take another look:
> > When I invoke a TSS command with a "/* COMMENT", the comment is seen
> > (and improperly handled) by the TSS command. When I write a REXX command
> > and then invoke it, the comment is seen by the REXX command. The TSO
> > parser is not stripping the comment from the command; the command sees it
> > and therefore must process it.
> >
> >
> > -----Original Message-----
> > From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On
> > Behalf Of James Campbell
> > Sent: Saturday, July 8, 2017 01:29
> >
> > Where you are getting confused is that the parser runs as a subroutine
> > of the command processor (unless you want to do it yourself).
> >
> > So the command processor does see the comment (in the command string)
> > and the parser does hide the comment from the command - because there
> > is nowhere in the syntax structure for the comment (or comments) to be
> > handed back to the command.
> >
> > https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v
> > 2r1.ikjb700/chparse.htm
> >
> > > --- On 2017-07-05, at 14:45, Bob Bridges wrote:
> > > > Here's an odd one I just encountered - not to do with REXX itself
> > > > but rather with the way TSO itself handles comments in TSOcommands.
> > > >
> > > > According to the TSO Command Reference (see
> > > > http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/
> > > > 1.2.2), you can include comments in a TSO command, like this for
> > > > example:
> > > >
> > > > tso help xmit /* this is a comment
> > > >
> > > > You can close the comment with "*/", but if there's nothing else
> > > > on the line you don´t have to. Ok, I knew that; I use it often
> > > > when writing a REXX that puts commands into a PDS so that I can
> > > > examine the commands before executing them.
> > > >
> > > > Here's the surprise: Since everything after "/*" in a TSO command
> > > > is a comment, I assumed that the TSO command parser would omit
> > > > the comment when passing the arguments on to whatever command is
> > > > being executed. For example, if in a CLIST appears this:
> > > >
> > > > TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY
> > > >
> > > > ...I supposed that what the TSS command would see is "ADD(DWHIT12)
> > > > PROF(PROF1234)", with the comment stripped out. Otherwise,
> > > > ~every~ command that is ever called by TSO would have to know what
> > > > to do with "/*".
> > > >
> > > > And apparently every command does. I just wrote a quick REXX to
> > > > say the arguments. When I call it from the READY prompt it shows
> > > > the whole command line including the comment:
> > > >
> > > > X arg /* more args
> > > > ARG /* MORE ARGS
> > > > READY
> > > >
> > > > When I execute it from ISPF it's even weirder:
> > > >
> > > > Command ===> tso x arg /* more args ARG /* MORE ARGS)
> > > > ***
> > > >
> > > > ISPF is apparently adding a right paren to the command. But it
> > > > doesn't do that when I close the comment:
> > > >
> > > > Command ===> tso x arg /* more args */ ARG /* MORE ARGS */
> > > > ***
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Bob Bridges
2017-07-10 00:01:43 UTC
Permalink
Yeah, that's what I'm saying I expected too. Here's the code:

/* This REXX tests TSO command invocation. */
trace 'R'
arg args
say 'ARGS="'args'"'
exit 0

Here's what happens when I run this from an ISPF command line:

Command ===> tso x arg /* comment
3 *-* arg args
>>> "ARG /* COMMENT)"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="ARG /* COMMENT)""
ARGS="ARG /* COMMENT)"
5 *-* exit 0
>>> "0"

Option ===> tso x arg /* comment */ more args
3 *-* arg args
>>> "ARG /* COMMENT */ MORE ARGS"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="ARG /* COMMENT */ MORE ARGS""
ARGS="ARG /* COMMENT */ MORE ARGS"
5 *-* exit 0
>>> "0"

Here's what happens when I run it from the READY prompt:

READY
x arg /* comment
3 *-* arg args
>>> "ARG /* COMMENT"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="ARG /* COMMENT""
ARGS="ARG /* COMMENT"
5 *-* exit 0
>>> "0"
READY
x arg /* comment */ more args
3 *-* arg args
>>> "ARG /* COMMENT */ MORE ARGS"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="ARG /* COMMENT */ MORE ARGS""
ARGS="ARG /* COMMENT */ MORE ARGS"
5 *-* exit 0
>>> "0"
READY

I just learned something new: When I run it with the comment first, it
behaves as I would have expected:

Option ===> tso x /* just a comment
3 *-* arg args
>>> ""
4 *-* say 'ARGS="'args'"'
>>> "ARGS="""
ARGS=""
5 *-* exit 0
>>> "0"

Option ===> tso x /* comment */ and arguments
3 *-* arg args
>>> "AND ARGUMENTS"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="AND ARGUMENTS""
ARGS="AND ARGUMENTS"
5 *-* exit 0
>>> "0"

READY
x /* just a comment
3 *-* arg args
>>> ""
4 *-* say 'ARGS="'args'"'
>>> "ARGS="""
ARGS=""
5 *-* exit 0
>>> "0"
READY
x /* comment */ args
3 *-* arg args
>>> "ARGS"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="ARGS""
ARGS="ARGS"
5 *-* exit 0
>>> "0"
READY

I'll run these commands from a CLIST and let you know what happens.

---
Bob Bridges
***@gmail.com, cell 336 382-7313
***@InfoSecInc.com

/* Sometimes patriotism means defending your country against its government.
-Edward Abbey */


--- On 7 Jul 2017 at 6:42, Paul Gilmartin wrote:
> I wouldn't expect "every command" to do that, but the parser to do it
> so the command itself never sees the comment.

> Can you post the Rexx code itself, verbatim, so we can understand better?
> Add a "trace R" at the beginning so we can see what Rexx does, and
> post the result.

> --- On 2017-07-05, at 14:45, Bob Bridges wrote:
> > Here's an odd one I just encountered - not to do with REXX itself but
rather with the way TSO itself handles comments in TSO
> > commands.
> >
> > According to the TSO Command Reference (see
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/1.2.2),
you can
> > include comments in a TSO command, like this for example:
> >
> > tso help xmit /* this is a comment
> >
> > You can close the comment with "*/", but if there's nothing else on the
line you don´t have to. Ok, I knew that; I use it often
> > when writing a REXX that puts commands into a PDS so that I can examine
the commands before executing them.
> >
> > Here's the surprise: Since everything after "/*" in a TSO command is a
comment, I assumed that the TSO command parser would omit
> > the comment when passing the arguments on to whatever command is being
executed. For example, if in a CLIST appears this:
> >
> > TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY
> >
> > ...I supposed that what the TSS command would see is "ADD(DWHIT12)
PROF(PROF1234)", with the comment stripped out. Otherwise,
> > ~every~ command that is ever called by TSO would have to know what to do
with "/*".
> >
> > And apparently every command does. I just wrote a quick REXX to say the
arguments. When I call it from the READY prompt it shows
> > the whole command line including the comment:
> >
> > X arg /* more args
> > ARG /* MORE ARGS
> > READY
> >
> > When I execute it from ISPF it's even weirder:
> >
> > Command ===> tso x arg /* more args ARG /* MORE ARGS)
> > ***
> >
> > ISPF is apparently adding a right paren to the command. But it doesn't
do that when I close the comment:
> >
> > Command ===> tso x arg /* more args */ ARG /* MORE ARGS */
> > ***
> >
> > This is not at all what I expected, and I don't understand the rationale
for it. Is it documented anywhere?

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2017-07-10 01:21:45 UTC
Permalink
On 2017-07-09, at 18:02, Bob Bridges wrote:

> Yeah, that's what I'm saying I expected too. Here's the code:
>
> /* This REXX tests TSO command invocation. */
> trace 'R'
> arg args
> say 'ARGS="'args'"'
> exit 0
>
> Here's what happens when I run this from an ISPF command line:
>
> Command ===> tso x arg /* comment
> 3 *-* arg args
>>>> "ARG /* COMMENT)"
> 4 *-* say 'ARGS="'args'"'
>>>> "ARGS="ARG /* COMMENT)""
> ARGS="ARG /* COMMENT)"
> 5 *-* exit 0
>>>> "0"
>
Shame on ISPF! On recognizing the TSO command, it should just
pass the remainder of the command line, unmodified, ASIS, to TSO,
preserving trailing blanks and any leading blanks after the
initial delimiting blank. Lately, the ALLOCATE command has
case sensitive arguments ("PATH()"), and the argument of the
SEND command has been case-sensitive as long as I remember.
ISPF is chaotic: some panels pass the TSO command argument as
it was typed; others force it to UPPER case.

And it *really* shouldn't append a parenthis or any other
character(s) whatever; it shouldn't second-guess TSO.

You can better see this if you use PARSE ARG rather than ARG, or
"SAY ARG(1)", either of which shows the argument string verbatim.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Jeremy Nicoll
2017-07-10 10:03:32 UTC
Permalink
On Mon, 10 Jul 2017, at 02:22, Paul Gilmartin wrote:
> On 2017-07-09, at 18:02, Bob Bridges wrote:

> > Here's what happens when I run this from an ISPF command line:
> >
> > Command ===> tso x arg /* comment
> > 3 *-* arg args
> >>>> "ARG /* COMMENT)"
> > 4 *-* say 'ARGS="'args'"'
> >>>> "ARGS="ARG /* COMMENT)""
> > ARGS="ARG /* COMMENT)"
> > 5 *-* exit 0
> >>>> "0"
> >
> Shame on ISPF! On recognizing the TSO command

Unless this has all changed since way back when, when I last used ispf,
the
point is that ispf doesn't "recognise a tso command".

All that happens is that that leading "tso" is translated by an entry in
the ispf
command table into something else that ispf then executes. IIRC it's
something
like

TSO SELECT CMD(&ZPARM)

so when you type

TSO blah blah blah

ispf executes

SELECT CMD(blah blah blah)

which should then do exactly the same thing as, in a rexx exec,


address ispexec "SELECT CMD(blah blah blah)"

and the right bracket is there because it's part of the SELECT CMD()
syntax.


You just as well have a command table entry that maps eg PENGUIN onto
the
same command, ie

PENGUIN SELECT CMD(&ZPARM)

and execute

PENGUIN blah blah blah

which should demonstrate that there's no "recognition" going on.


In the SELECT command, the fact that the parameter is wrapped in
"CMD()"
means that it's going to be assumed that it is a tso command, very often
a
clist or rexx exec rather than a properly written tso command processor,
and
- for example - if you're using a command table entry to shortcut
invoking an
exec/clist of your own it's much better to define in the command table
something like

XYZ SELECT CMD(%myxyz &ZPARM)

than to leave out the "%".

If you're using a command table entry to call something that's not a tso
command
processor, you'd use SELECT PGM().


> And it *really* shouldn't append a parenthis or any other
> character(s) whatever; it shouldn't second-guess TSO.

It isn't "second-guessing" TSO. "TSO" is just a shorthand for SELECT
CMD().

--
Jeremy Nicoll - my opinions are my own.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2017-07-10 14:03:16 UTC
Permalink
On 2017-07-10, at 04:04, Jeremy Nicoll wrote:
>>>
>> Shame on ISPF! On recognizing the TSO command
>
> Unless this has all changed since way back when, when I last used ispf,
> the
> point is that ispf doesn't "recognise a tso command".
>
Excuse me; I should have said, "on recognizing the token, 'TSO'"
> All that happens is that that leading "tso" is translated by an entry in
> the ispf
> command table into something else that ispf then executes. IIRC it's
> something
> like
>
> TSO SELECT CMD(&ZPARM)
>
> so when you type
>
> TSO blah blah blah
>
> ispf executes
>
> SELECT CMD(blah blah blah)
>
> which should then do exactly the same thing as, in a rexx exec,
>
> address ispexec "SELECT CMD(blah blah blah)"
>
> and the right bracket is there because it's part of the SELECT CMD()
> syntax.
>
The design is just plain wrong. It should do the same as in a Rexx exec,

address TSO 'blah blah blah'

... no uppercasing; no other lexical munging.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Bob Bridges
2017-07-11 02:48:22 UTC
Permalink
Again, Gil, I see your comments below but they didn't appear in my TSO-REXX folder. Kind of frustrating.

Jeremy, I don't understand what you're saying about the extra parenthesis that's added by ISPF. You seem to think it's natural and right - "...and the right bracket is there because it's part of the SELECT CMD() syntax" - but it isn't, it's purely a bug. I'm perfectly happy to agree that ISPF isn't "second-guessing" TSO - poor choice of words, IMHO - but it's sticking an extra character into the args that the user didn't put there, and it's doing it only when the user put a certain type of comment in the command.

I say "certain type" because it happens only when 1) the command is invoked through ISPF, 2) prefixed with "TSO" (it doesn’t happen if you leave off "TSO" and invoke from option 6), 3) there's at least one argument before the comment and 4) the comment doesn't end with '*/'. Bug. I started out wondering what was wrong with my understanding, but this is clearly a bug.

---
Bob Bridges
***@gmail.com, cell 336 382-7313
***@InfoSecInc.com

/* Excellence is an art won by training and habituation. We do not act rightly because we have virtue or excellence, but rather we have those because we have acted rightly. We are what we repeatedly do. Excellence, then, is not an act but a habit. -Aristotle */


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Jeremy Nicoll
Sent: Monday, July 10, 2017 06:04

--- On Mon, 10 Jul 2017, at 02:22, Paul Gilmartin wrote:

> --- On 2017-07-09, at 18:02, Bob Bridges wrote:
> > Here's what happens when I run this from an ISPF command line:
> >
> > Command ===> tso x arg /* comment
> > 3 *-* arg args
> >>>> "ARG /* COMMENT)"
> > 4 *-* say 'ARGS="'args'"'
> >>>> "ARGS="ARG /* COMMENT)""
> > ARGS="ARG /* COMMENT)"
> > 5 *-* exit 0
> >>>> "0"
> >
> Shame on ISPF! On recognizing the TSO command

Unless this has all changed since way back when, when I last used ispf, the point is that ispf doesn't "recognise a tso command".

All that happens is that that leading "tso" is translated by an entry in the ispf command table into something else that ispf then executes. IIRC it's something like

TSO SELECT CMD(&ZPARM)

so when you type

TSO blah blah blah

ispf executes

SELECT CMD(blah blah blah)

which should then do exactly the same thing as, in a rexx exec,


address ispexec "SELECT CMD(blah blah blah)"

and the right bracket is there because it's part of the SELECT CMD() syntax.


You just as well have a command table entry that maps eg PENGUIN onto the same command, ie

PENGUIN SELECT CMD(&ZPARM)

and execute

PENGUIN blah blah blah

which should demonstrate that there's no "recognition" going on.


In the SELECT command, the fact that the parameter is wrapped in "CMD()" means that it's going to be assumed that it is a tso command, very often a clist or rexx exec rather than a properly written tso command processor, and - for example - if you're using a command table entry to shortcut invoking an exec/clist of your own it's much better to define in the command table something like

XYZ SELECT CMD(%myxyz &ZPARM)

than to leave out the "%".

If you're using a command table entry to call something that's not a tso command processor, you'd use SELECT PGM().


> And it *really* shouldn't append a parenthesis or any other character(s) whatever; it shouldn't second-guess TSO.

It isn't "second-guessing" TSO. "TSO" is just a shorthand for SELECT CMD().

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2017-07-11 04:07:09 UTC
Permalink
On 2017-07-10, at 20:49, Bob Bridges wrote:

> Again, Gil, I see your comments below but they didn't appear in my TSO-REXX folder. Kind of frustrating.
>
Lately, I've gotten backscatter from LISTSERVs implying that
an MTA used by AOL.com is blacklisted. It may be that GMail
follows a similar blacklist but doesn't backscatter. Ugh!

> Jeremy, I don't understand what you're saying about the extra parenthesis that's added by ISPF. You seem to think it's natural and right - "...and the right bracket is there because it's part of the SELECT CMD() syntax" - but it isn't, it's purely a bug. I'm perfectly happy to agree that ISPF isn't "second-guessing" TSO - poor choice of words, IMHO - but it's sticking an extra character into the args that the user didn't put there, and it's doing it only when the user put a certain type of comment in the command.
>
> I say "certain type" because it happens only when 1) the command is invoked through ISPF, 2) prefixed with "TSO" (it doesn’t happen if you leave off "TSO" and invoke from option 6), 3) there's at least one argument before the comment and 4) the comment doesn't end with '*/'. Bug. I started out wondering what was wrong with my understanding, but this is clearly a bug.
>
It may be a bug; it may be a feature: WAD/BAD. I know that once I had
an initial command to ISPF that I couldn't use because ISPF considered
it a syntax error. That should be none of ISPF's business -- it should
just issue the command.

You might be able to probe with such as:
/* Rexx */
trace R
address TSO "send 'Hello" date() "/* */" time()" user("userid()")"
address ISPEXEC "TSO send 'Hello" date() "/* */" time()" user("userid()")"

... other variants ad lib. (If I counted my apostrophes right.)

If there is any TSO command I can send from Rexx (which I trust) with
"address TSO ..." that I can not send with "address ISPEXEC TSO ...",
I consider the design of ISPEXEC deficient.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Bob Bridges
2017-07-10 00:07:32 UTC
Permalink
I took the Trace statement out of X and then created a CLIST with the
following statements:

X ARG /* COMMENT
X ARG /* COMMENT */ MORE ARGS
X /* JUST A COMMENT
X /* COMMENT FIRST */ AND MORE ARGS

I named that X2. Nothing very surprising, here; it acts the same except
that it never adds the extra right paren. Here's how it looks from ISPF:

Option ===> tso x2
ARGS="ARG /* COMMENT"
ARGS="ARG /* COMMENT */ MORE ARGS"
ARGS=""
ARGS="AND MORE ARGS"

Now from the READY prompt:

READY
x2
ARGS="ARG /* COMMENT"
ARGS="ARG /* COMMENT */ MORE ARGS"
ARGS=""
ARGS="AND MORE ARGS"
READY

---
Bob Bridges
***@gmail.com, cell 336 382-7313
***@InfoSecInc.com

/* Sometimes patriotism means defending your country against its government.
-Edward Abbey */


-----Original Message-----
From: Bob Bridges [mailto:***@gmail.com]
Sent: Sunday, July 9, 2017 20:03

Yeah, that's what I'm saying I expected too. Here's the code:

/* This REXX tests TSO command invocation. */
trace 'R'
arg args
say 'ARGS="'args'"'
exit 0

Here's what happens when I run this from an ISPF command line:

Command ===> tso x arg /* comment
3 *-* arg args
>>> "ARG /* COMMENT)"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="ARG /* COMMENT)""
ARGS="ARG /* COMMENT)"
5 *-* exit 0
>>> "0"

Option ===> tso x arg /* comment */ more args
3 *-* arg args
>>> "ARG /* COMMENT */ MORE ARGS"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="ARG /* COMMENT */ MORE ARGS""
ARGS="ARG /* COMMENT */ MORE ARGS"
5 *-* exit 0
>>> "0"

Here's what happens when I run it from the READY prompt:

READY
x arg /* comment
3 *-* arg args
>>> "ARG /* COMMENT"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="ARG /* COMMENT""
ARGS="ARG /* COMMENT"
5 *-* exit 0
>>> "0"
READY
x arg /* comment */ more args
3 *-* arg args
>>> "ARG /* COMMENT */ MORE ARGS"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="ARG /* COMMENT */ MORE ARGS""
ARGS="ARG /* COMMENT */ MORE ARGS"
5 *-* exit 0
>>> "0"
READY

I just learned something new: When I run it with the comment first, it
behaves as I would have expected:

Option ===> tso x /* just a comment
3 *-* arg args
>>> ""
4 *-* say 'ARGS="'args'"'
>>> "ARGS="""
ARGS=""
5 *-* exit 0
>>> "0"

Option ===> tso x /* comment */ and arguments
3 *-* arg args
>>> "AND ARGUMENTS"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="AND ARGUMENTS""
ARGS="AND ARGUMENTS"
5 *-* exit 0
>>> "0"

READY
x /* just a comment
3 *-* arg args
>>> ""
4 *-* say 'ARGS="'args'"'
>>> "ARGS="""
ARGS=""
5 *-* exit 0
>>> "0"
READY
x /* comment */ args
3 *-* arg args
>>> "ARGS"
4 *-* say 'ARGS="'args'"'
>>> "ARGS="ARGS""
ARGS="ARGS"
5 *-* exit 0
>>> "0"
READY

I'll run these commands from a CLIST and let you know what happens.


--- On 7 Jul 2017 at 6:42, Paul Gilmartin wrote:
> I wouldn't expect "every command" to do that, but the parser to do it
> so the command itself never sees the comment.

> Can you post the Rexx code itself, verbatim, so we can understand better?
> Add a "trace R" at the beginning so we can see what Rexx does, and
> post the result.

> --- On 2017-07-05, at 14:45, Bob Bridges wrote:
> > Here's an odd one I just encountered - not to do with REXX itself
> > but rather with the way TSO itself handles comments in TSO commands.
> >
> > According to the TSO Command Reference (see
> >
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/1.2.2),
you can include comments in a TSO command, like this for example:
> >
> > tso help xmit /* this is a comment
> >
> > You can close the comment with "*/", but if there's nothing else on
> > the line you don´t have to. Ok, I knew that; I use it often when
writing a REXX that puts commands into a PDS so that I can examine the
commands before executing them.
> >
> > Here's the surprise: Since everything after "/*" in a TSO command
> > is a comment, I assumed that the TSO command parser would omit the
comment when passing the arguments on to whatever command is being executed.
For example, if in a CLIST appears this:
> >
> > TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY
> >
> > ...I supposed that what the TSS command would see is "ADD(DWHIT12)
> > PROF(PROF1234)", with the comment stripped out. Otherwise, ~every~
command that is ever called by TSO would have to know what to do with "/*".
> >
> > And apparently every command does. I just wrote a quick REXX to say
> > the arguments. When I call it from the READY prompt it shows the whole
command line including the comment:
> >
> > X arg /* more args
> > ARG /* MORE ARGS
> > READY
> >
> > When I execute it from ISPF it's even weirder:
> >
> > Command ===> tso x arg /* more args ARG /* MORE ARGS)
> > ***
> >
> > ISPF is apparently adding a right paren to the command. But it doesn't
do that when I close the comment:
> >
> > Command ===> tso x arg /* more args */ ARG /* MORE ARGS */
> > ***
> >
> > This is not at all what I expected, and I don't understand the rationale
for it. Is it documented anywhere?

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Bob Bridges
2017-07-10 00:10:13 UTC
Permalink
By the way, Gil, I never saw your post directly, only in Mr Campbell's
reply. I don't know why I couldn't see your post myself.

---
Bob Bridges
***@gmail.com, cell 336 382-7313
***@InfoSecInc.com

/* re-cur-sive (ri: 'kr sIv), from "re-" + Lat. "cursire" (to say "Oh, hell,
not AGAIN!"): See "recursive". */


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
James Campbell
Sent: Saturday, July 8, 2017 01:29
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Comments in TSO commands

Where you are getting confused is that the parser runs as a subroutine of
the command processor (unless you want to do it yourself).

So the command processor does see the comment (in the command string) and
the parser does hide the comment from the command - because there is nowhere
in the syntax structure for the comment (or comments) to be handed back to
the command.

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ik
jb700/ch
parse.htm

James Campbell

--- On 7 Jul 2017 at 6:42, Paul Gilmartin wrote:

> --- On 2017-07-05, at 14:45, Bob Bridges wrote:
> > Here's an odd one I just encountered - not to do with REXX itself but
rather with the way TSO itself handles comments in TSO commands.
> >
> > According to the TSO Command Reference (see
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/1.2.2),
you can include comments in a TSO command, like this for example:
> >
> > tso help xmit /* this is a comment
> >
> > You can close the comment with "*/", but if there's nothing else on the
line you don´t have to. Ok, I knew that; I use it often when writing a REXX
that puts commands into a PDS so that I can examine the commands before
executing them.
> >
> > Here's the surprise: Since everything after "/*" in a TSO command is a
comment, I assumed that the TSO command parser would omit the comment when
passing the arguments on to whatever command is being executed. For
example, if in a CLIST appears this:
> >
> > TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY
> >
> > ...I supposed that what the TSS command would see is "ADD(DWHIT12)
PROF(PROF1234)", with the comment stripped out. Otherwise, ~every~ command
that is ever called by TSO would have to know what to do with "/*".
> >
> > And apparently every command does. I just wrote a quick REXX to say the
arguments. When I call it from the READY prompt it shows the whole command
line including the comment:
> >
> I wouldn't expect "every command" to do that, but the parser to do it
> so the command itself never sees the comment.
>
> > X arg /* more args
> > ARG /* MORE ARGS
> > READY
> >
> > When I execute it from ISPF it's even weirder:
> >
> > Command ===> tso x arg /* more args ARG /* MORE ARGS)
> > ***
> >
> > ISPF is apparently adding a right paren to the command. But it doesn't
do that when I close the comment:
> >
> > Command ===> tso x arg /* more args */ ARG /* MORE ARGS */
> > ***
> >
> Can you post the Rexx code itself, verbatim, so we can understand better?
> Add a "trace R" at the beginning so we can see what Rexx does, and
> post the result.
>
> > This is not at all what I expected, and I don't understand the rationale
for it. Is it documented anywhere?
>
> -- gil
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions, send
> email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email
to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Bob Bridges
2017-07-11 02:36:32 UTC
Permalink
I see where James Campbell wrote "the parser does hide the comment from the
command". My tests seem to show it does ~not~ hide the comment from the
command. He may not have written what he meant (and I'm not sneering, I do
that too), but if so it's not obvious to me.

However, you're right about this: "I think you're assuming the parsing
happens when TSO reads the command line, before it calls the command
processor that supports the command concerned." That is exactly what I
assumed. My tests seem to show that my assumption was wrong; apparently the
TSO command parser looks only enough to get the name of the command, ie the
program or CLIST name, and then passes the rest to the target without
further inspection. No, that's not right either, for earlier today I
discovered that the comment ~is~ removed from the arguments if the comment
comes ~before~ any arguments. If any argument appears before a comment,
then the whole arg string is passed including the comment.

It's hard to understand how the TSO documentation could say (I refer you
again to
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/1.2.2)
"You can include comments in a TSO/E command anywhere a blank might appear"
and so on. That clearly communicates that the comment will be stripped from
the arguments before the arg string is handed to your REXX. I know it ain't
so; but it's the only reasonable interpretation of the documentation. Isn't
it?

---
Bob Bridges
***@gmail.com, cell 336 382-7313
***@InfoSecInc.com

/* Excellence is an art won by training and habituation. We do not act
rightly because we have virtue or excellence, but rather we have those
because we have acted rightly. We are what we repeatedly do. Excellence,
then, is not an act but a habit. -Aristotle */


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Jeremy Nicoll
Sent: Monday, July 10, 2017 05:46

You must have misunderstood, for that's what James Campbell said.

But, you talk about "the parser" as if its functioning is going to be the
same for all TSO command processors. It's not. It depends entirely on how
(and indeed, if) the coder of the command processor chose to use IKJPARS.
There's also the chance that they set that up and call it then don't
properly use the parsed values it returns.

(I think you're assuming the parsing happens when TSO reads the command
line, before it calls the command processor that supports the command
concerned.)

So, you're comparing the way the author of the TSS command processor chose
to use IKJPARS, versus the way that IBM wrote eg the EXEC command processor.

--- On Mon, 10 Jul 2017, at 00:48, Bob Bridges wrote:
> Unless I misunderstood you, what I wrote below proves that the parser does
~not~ hide the comment from the command.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
James Campbell
Sent: Saturday, July 8, 2017 01:29

Where you are getting confused is that the parser runs as a subroutine of
the command processor (unless you want to do it yourself).

So the command processor does see the comment (in the command string) and
the parser does hide the comment from the command - because there is nowhere
in the syntax structure for the comment (or comments) to be handed back to
the command.

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ik
jb700/chparse.htm

> --- On 2017-07-05, at 14:45, Bob Bridges wrote:
> > Here's an odd one I just encountered - not to do with REXX itself but
rather with the way TSO itself handles comments in
> > TSO commands.
> >
> > According to the TSO Command Reference (see
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj3c530/1.2.2),
> > you can include comments in a TSO command, like this for example:
> >
> > tso help xmit /* this is a comment
> >
> > You can close the comment with "*/", but if there's nothing else on the
line you don´t have to. Ok, I knew that; I use
> > it often when writing a REXX that puts commands into a PDS so that I can
examine the commands before executing them.
> >
> > Here's the surprise: Since everything after "/*" in a TSO command is a
comment, I assumed that the TSO command parser
> > would omit the comment when passing the arguments on to whatever command
is being executed. For example, if in a CLIST
> > appears this:
> >
> > TSS ADD(DWHIT12) PROF(PROF1234) /* DAVE WHITLEY
> >
> > ...I supposed that what the TSS command would see is "ADD(DWHIT12)
PROF(PROF1234)", with the comment stripped out.
> > Otherwise, ~every~ command that is ever called by TSO would have to know
what to do with "/*".
> >
> > And apparently every command does. I just wrote a quick REXX to say the
arguments. When I call it from the READY
> > prompt it shows the whole command line including the comment:
> >
> > X arg /* more args
> > ARG /* MORE ARGS
> > READY
> >
> > When I execute it from ISPF it's even weirder:
> >
> > Command ===> tso x arg /* more args ARG /* MORE ARGS)
> > ***
> >
> > ISPF is apparently adding a right paren to the command. But it doesn't
do that when I close the comment:
> >
> > Command ===> tso x arg /* more args */ ARG /* MORE ARGS */
> > ***
> >
> > This is not at all what I expected, and I don't understand the rationale
for it. Is it documented anywhere?

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Loading...