z/OS TSO/E REXX Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Comments

z/OS TSO/E REXX Reference
SA32-0972-00

A comment is a sequence of characters (on one or more lines) delimited by /* and */. Within these delimiters any characters are allowed. Comments can contain other comments, as long as each begins and ends with the necessary delimiters. They are called nested comments. Comments can be anywhere and can be of any length. They have no effect on the program, but they do act as separators. (Two tokens with only a comment in between are not treated as a single token.)
/* This is an example of a valid REXX comment */
Take special care when commenting out lines of code containing /* or */ as part of a literal string. Consider the following program segment:
01    parse pull input
02    if substr(input,1,5) = '/*123'
03      then call process
04    dept = substr(input,32,5)
To comment out lines 2 and 3, the following change would be incorrect:
01    parse pull input
02 /* if substr(input,1,5) = '/*123'
03      then call process
04 */ dept = substr(input,32,5)

This is incorrect because the language processor would interpret the /* that is part of the literal string /*123 as the start of a nested comment. It would not process the rest of the program because it would be looking for a matching comment end (*/).

You can avoid this type of problem by using concatenation for literal strings containing /* or */; line 2 would be:
if substr(input,1,5) = '/' || '*123'
You could comment out lines 2 and 3 correctly as follows:
01    parse pull input
02 /* if substr(input,1,5) = '/' || '*123'
03      then call process
04 */ dept = substr(input,32,5)

For information about Double-Byte Character Set characters, see Double-byte character set (DBCS) support and the OPTIONS instruction in topicOPTIONS.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014