In any REXX I write that has to know, I include this statement at the beginning:
fbat=(sysvar('SYSENV')='BACK') If SYSVAR('SYSENV') is "BACK", it's running in the background so I set the fbat flag. Elsewhere in the program it checks FBAT: if fbat then 'look for a DD else 'use a predetermined DSN Hm, no one ever told me choosing a random DD name is passé. I have a TEMPDD routine that returns a DD name guaranteed to be unused; otherwise many of my routines would end up conflicting whenever I use them recursively (sort of). --- Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313 /* There is no harm in being sometimes wrong — especially if one is promptly found out. -John Maynard Keynes, Essays in Biography (1933) */ -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin Sent: Tuesday, March 31, 2020 14:15 How do you tell? PARSE SOURCE will distinguish IRXJCL and OMVS, but TSO, IKJEFT01, and Edit are ambiguous. Why, why do macros start with TSO rather than the more useful ISREDIT? Too often I find myself coding: ADDRESS ISREDIT TRACE OFF MACRO (PARM) IF RC<>0 then PARSE ARG PARM ... For TSO, I rely when I can on BPXWDYN( 'ALLOC RTDDN(...) ...' ) to avoid conflict with DDNAMEs in other threads. (Choosing a random DDNAME is *so* 20th century.) --- On Tue, 31 Mar 2020 12:20:27 -0400, Bob Bridges wrote: > ... So such a REXX is updated to say "if I'm running in batch, look for > this DD name; otherwise use this DSN". ... ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN