View previous topic :: View next topic
|
Author |
Message |
Shrinika Rajendran
New User
Joined: 06 Jun 2013 Posts: 25 Location: India
|
|
|
|
Hi All,
I would like to extract a few members from a PDS.
I can always get all the members using the below
Code: |
//SYSTSIN DD *
LISTDS 'your pds name' MEMBERS
/* |
and get the required members using sort in the next step. But, is there a way to get it done using the above syntax itself?
Is there something called LEVEL keyword allowed in the LISTDS option? How do I use it? I could not get info on this.
Thanks
Re-titled |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
No.
A couple of years ago I tried something similar: dsname(xx*) (e.g., specify some sort of member selection mask in the data set name, like in ISPF), but I couldn't figure out a way to get it by IKJPARS. I ended up adding a keyword, MASK(xx*), if I remember correctly, but I was never happy with the solution.
FWIW, LISTD already has a LEVEL keyword, but it is for use with the data set name. I've never tried to use it. |
|
Back to top |
|
|
Paul Voyner
New User
Joined: 26 Nov 2012 Posts: 52 Location: UK
|
|
|
|
If you want to do it in REXX this will work.
Code: |
/*REXX*/
parse arg ds
if ds = '' then return
ADDRESS "TSO"
x = OUTTRAP("XXX.")
"LISTDS '"ds"' MEMBERS"
x = OUTTRAP("OFF")
k = -1
mem. = ''
do i = 1 to xxx.0
card = strip(xxx.i)
if card = '--MEMBERS--' & k = -1 then do; k=0 ; iterate; end
if k < 0 then iterate
k = k+1
mem.k = card
end
mem.0 = k
Say "Number of members found in "ds" is "mem.0 |
Code'd |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Does this have to be coded with LISTDS?
I think LMMLIST with PATTERN string input is best suited for this requirement.
There are several examples posted on this forum.
For instance: Check this link. |
|
Back to top |
|
|
Shrinika Rajendran
New User
Joined: 06 Jun 2013 Posts: 25 Location: India
|
|
|
|
Thanks all. I will give it a try. |
|
Back to top |
|
|
|