IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Extract selected members from a PDS with LISTDS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shrinika Rajendran

New User


Joined: 06 Jun 2013
Posts: 25
Location: India

PostPosted: Mon May 12, 2014 7:06 pm
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Mon May 12, 2014 8:04 pm
Reply with quote

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
View user's profile Send private message
Paul Voyner

New User


Joined: 26 Nov 2012
Posts: 52
Location: UK

PostPosted: Tue May 13, 2014 12:44 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Tue May 13, 2014 8:20 pm
Reply with quote

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
View user's profile Send private message
Shrinika Rajendran

New User


Joined: 06 Jun 2013
Posts: 25
Location: India

PostPosted: Wed May 14, 2014 9:11 am
Reply with quote

Thanks all. I will give it a try.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts optim extract file - SAS DB2 2
No new posts How to extract the data for current y... DFSORT/ICETOOL 8
Search our Forums:

Back to Top