OS/2 had a command called REXXTRY that would do what you want.  I was able to 
get permission from IBM to distributed it years ago (just after OS/2 ceased to 
be marketed) and you can get a copy at http://lbdsoftware.com/rexxtry.zip

 Have not tried it under OMVS but in theory it should work, perhaps with minor 
tweaking (one would hope).


Lionel B. Dyck <sdg><
Website: http://www.lbdsoftware.com

"Worry more about your character than your reputation.  Character is what you 
are, reputation merely what others think you are." - John Wooden

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
John McKown
Sent: Monday, March 16, 2020 8:52 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

Reply via email to