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:

/*
     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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to