Monday, August 22, 2016

REXX: How to read the Dataset and Member Name

In order to read the dataset and member name of the opened member, use the following REXX code. 

After executing this REXX code, the variable PDSNAME will contain the Dataset Name and Member will contain the member name. If the same REXX is applied to a PS file, then PS file name will be stored in variable PDSNAME and Member name will be empty. 

/*REXX*/
 "ISPEXEC CONTROL ERRORS RETURN"

 "ISREDIT MACRO (PARMS) NOPROCESS"                                              
 "ISREDIT (PDSNAME) = DATASET"                                                  
 "ISREDIT (MEMBER)  = MEMBER"          

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