Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Extract selected members from a PDS with LISTDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Extract selected members from a PDS with LISTDS
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: 534
Location: The Universe

PostPosted: Mon May 12, 2014 8:04 pm    Post subject:
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: 51
Location: Switz

PostPosted: Tue May 13, 2014 12:44 pm    Post subject:
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: 686
Location: Earth

PostPosted: Tue May 13, 2014 8:20 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Reading selected volumes of a multi-v... RickBig JCL & VSAM 6 Wed Jul 13, 2016 7:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us