I have two external REXX execs that I use frequently (depending on which one 
you need):

TEMPDD returns a DD name that is guaranteed not to be currently in use; it's up 
to the caller to allocate it.  I can specify a prefix; for example, if I call 
TEMPDD with arg "XYZ" then it might return "XYZ12345" or "XYZ01".

DSDD takes a string argument and returns a two-bit reply indicating whether the 
string indicates an catalogued DSN and/or a currently allocated DDN.  If I call 
DSDD with arg "XYZ", and it returns '01', then there's no DSN by that name but 
my TSO session is currently using that DDN.

Sounds like you'd be more interested in DSDD; it calls LISTDSI and checks both 
the RC and the reason code to figure out the correct reply.  It also displays a 
message if it runs into a combination of RC and reason code that isn't 
programmed into it, so that I can add it to the code, but I haven't seen that 
message in years.

I just checked the documentation I wrote for it; it returns not a two-digit 
reply but the values 0, 1, 2 or 3, which I must interpret as representing two 
bits as described above.

---
Bob Bridges, [email protected], cell 336 382-7313

/* The real art of conversation is not only to say the right thing in the right 
place, but to leave unsaid the wrong thing at the tempting moment.  -Dorothy 
Nevill */

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Billy Ashton
Sent: Wednesday, August 21, 2024 15:28

In my Rexx program, before I try to do an EXECIO against it, I want to do 
something to make sure the DD statement is there and control the error. I tried 
ListDSI, but that only works on DASD files and not on instream (DD *) data.

How can I test that I have the ABCXYZ DD statement allocated, if it is DD * or 
DD DATA? Likewise, how can I test for DD JKLMNO that is allocated to SYSOUT=* 
to be sure it is there (as I am writing via EXECIO to it)?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to