Thursday, March 5, 2020

REXX: Reading the dataset name of a DDNAME

/* REXX */
ddinfo = LISTDSI("DDNAME" "FILE")   
Say "Dataset Name: "SYSDSNAME     
Say "RC : " ddinfo
Exit

To run this REXX in background mode, use IKJEFT01 utility. Also, note LISTDSI works well with IKJEFT01 utility.

An incorrect ddname would lead to RC 16.

If the keyword "FILE" is ignored, LISTDSI would assume that the given value is a dataset name.

If you'd like to know the sysexec dataset of your profile, try "SYSEXEC" in place of the ddname. This can be run in foreground mode.

No comments:

Post a Comment

Featured Post

REXX Skeleton: Submitting jobs through Rexx

Submitting jobs through REXX and reading the spool through REXX gives us immense potential to automate many manual activities in mainframes....