Well, if you didn't need to support TSO then I'd suggest using here documents. It should be easy enough to do what you asked using interpret, although in a Unix environment the user would have to escape, e.g., all of his quotation marks.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List [[email protected]] on behalf of John McKown [[email protected]] Sent: Monday, March 16, 2020 9:51 AM To: [email protected] Subject: Scripting REXX thought -- inspiration or insanity? One thing I like about "awk" and "PERL" is that I can easily script them from the UNIX command line. "awk" has an implicit read loop. PERL has the -n switch to force an implicit read loop. I would love something similar for REXX. Especially when invoked from the UNIX shell, but even from the TSO command line. In both cases, the command line could take a list of input datasets (TSO) or files (UNIX) to process. A simple REXX, based on PERL, example might be: rexx -n -e 'say $_;' some.dsn.or.file This would simply print every line in the "some.dsn.or.file" to the screen. I used the PERL switches of "-n" to tell REXX to loop over every line in the input, assigning the entire like to the $_ variable (again from PERL) and the "-e" to specify the statement(s) to execute. Like PERL, this REXX should accept multiple "-e" switches and collect them together, in order, to create the actual REXX script. A couple more examples might be: rexx -n -e 'say $_' -e 'say "has "words($_)" words in it." some.dsn.or.file or even: rexx -n -e 'say $_;say "has "words($_) words in it.";' some.dsn.or.file IMO, for TSO the "some.dsn.or.file" would default to the normal TSO default of a DSN (possibly prefixed) but would accept a UNIX file if the first character is a forward slash: e.g. /etc/inetd.conf For UNIX, "some.dsn.or.file" would default to a UNIX file, unless prefixed by a double forward slash. E.g. "//'sys1.maclib(read)'" or "//pds.cntl(member)" which would be prefixed by the UNIX ${LOGNAME}. Oh, without the -n switch the command would not have any implied I/O and so would need an explicit loop & do the parameter parsing itself. Otherwise it would just do the one statement like: rexx -e 'SAY "Hello World";' Who knows, maybe I should write this myself. But, honestly, it is difficult to get interested in much of anything anymore. -- People in sleeping bags are the soft tacos of the bear world. Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
