When we have only handful of members in a PDS, it is easily to make a list of their names. Imagine if we have 1000 members in a PDS. Some may do it manually but some use REXX script to do this task quickly.
Lets see how to do this in REXX.
PDSNAME="Your-PDS Name"
CALL OUTTRAP "MBRS."
"LISTD" "'"PDSNAME"'" "MEMBERS"
CALL OUTTRAP "OFF"
DO I=1 TO MBRS.0
IF MBRS.I = "--MEMBERS--" THEN LEAVE
END
I = I+1
DO MEM = I TO MBRS.0
Say "Member Name ;" MBRS.MEM
END
This code would display all the members in a PDS. Instead of displaying the member name you shall add your own logic to fulfill your requirement.
Subscribe to:
Post Comments (Atom)
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....
-
Abend S013 SYSTEM COMPLETION CODE=013 REASON CODE=00000018 AN OPEN WAS ISSUED FOR A PARTITIONED DATASET. THE SPECIFIED MEMBER NAME WAS N...
-
A word is defined as a blank delimited set of characters within a string in REXX. The characters in a word can be alpha, numeric, alphanume...
-
String functions interrogate, compare, and manipulate character strings of data. Some of the built-in function are listed below: COPIES...
Hi,
ReplyDeleteI have requirement like need to pull the given data (length 15) from mainframe file.
Here mainframe file is GDG versions given data should read these generations untill it found and pull it to new output dataset.
Can you please let me know can we do this in Rexx, if possible can you share few example to below gievn mail id.
Kondaprashanth@rocketmail.com