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 User


Joined: 30 Nov 2013
Posts: 460
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: 685
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 Reading selected volumes of a multi-v... RickBig JCL & VSAM 6 Wed Jul 13, 2016 7:26 pm
No new posts Single step utility for compare and u... ramprakashn JCL & VSAM 5 Fri Apr 29, 2016 3:43 pm
No new posts Differences between copying members b... E.LAI TSO/ISPF 8 Wed Mar 30, 2016 12:35 pm
No new posts Sort Logic to extract data scorp_rahul23 DFSORT/ICETOOL 13 Tue Mar 01, 2016 1:22 am
No new posts how to extract the member name ? jackzhang75 CLIST & REXX 1 Wed Feb 17, 2016 9:21 pm


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