BPXWUNIX is available to z/OS 1.13 too, so this should work under z/OS 1.13.  I 
am using BPXWUNIX to invoke USS dig command get info from the DNS server.

Al Nims
Systems Admin/Programmer 3
UFIT
University of Florida
(352) 273-1298

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Albert Ferguson
Sent: Tuesday, June 13, 2017 9:55 AM
To: [email protected]
Subject: Re: Sorting a REXX STEM variable

Under zOS REXX does have a STEM Sort (via BPXWUNIX). If you have an OMVS 
Segment on your USERID (and as of zOS 2.1+ you should), try this:
z
/*
     Do a Binary Sort (use -tn for Text)
     Using 2nd Word in each StemIn. Record as primary sort key
     Using 1st Word in each StemIn. Record as secondary sort key
     More doc on Unix Sort at 
http://publibz.boulder.ibm.com/epubs/pdf/bpx1cd10.pdf
*/
x = BPXWUNIX("/bin/sort -bn -k2,2 -k1,1","StemIn.","StemOut.")

Also available via the USS side of zOS is Regex support:

/*
    Get the JESMSGLG output from a JOB, e.g. via SDSF or (E)JES and put in the 
STEM JesMsgLg.
    Use the USS grep in, Extended mode, to search for all STEPS with an RC=12, 
16, or 20
    Return only those steps to the BadSteps. STEM variable ...

    Add a step using this at the very END of a JOB to determine if something 
did not go as expected, and then
    possibly correct it!
*/
x = BPXWUNIX("/bin/grep -E -e'¬.{30}(.{10}  (12|16|20)'", 
"JesMsgLg.","BadSteps.")

----------------------------------------------------------------------
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