Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to read all the members in a PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
teethu thomas

New User


Joined: 17 May 2007
Posts: 24
Location: India

PostPosted: Tue Jun 12, 2007 8:55 pm    Post subject: How to read all the members in a PDS
Reply with quote

Can some one explain me how to read each and every member in a PDS. We know only the PDS name and the PDS have some 100 members. We need to process each and every member in a PDS.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8620
Location: Back in jolly old England

PostPosted: Tue Jun 12, 2007 9:03 pm    Post subject:
Reply with quote

This has been discussed a few times

You could have searched the forum and found ....
http://ibmmainframes.com/viewtopic.php?t=20208&highlight=list+pds+members
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue Jun 12, 2007 9:09 pm    Post subject: Re: How to read all the members in a PDS
Reply with quote

1. Print the PDS to a sequential dataset using the IEBPTPCH program or the TSO PRINTDS command. Then, you can read through the entire PDS presented as a single sequential dataset.

2. Use the TSO LISTDS 'pdsname' MEMBERS command. Trap the resulting output into REXX stem variables. In a loop, allocate the PDS and member, and read through the member with EXECIO. In addition to the LISTDS command, you can use the REXX code specified here to generate a member list.

3. Processing a PDS equals using ISPF Library Management (LM) Services. Use the LMINIT and LMMLIST services to allocate the PDS and loop through the members. Use either EXECIO or LMGET to process the PDS member content. The nice thing about this option is that you can perform this in just about any programming language you wish to use.

Examples of any of these processes are abundant throughout these topics.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1544
Location: Andromeda Galaxy

PostPosted: Wed Jun 13, 2007 11:51 am    Post subject:
Reply with quote

teethu thomas,

Try this code

Code:



/*REXX*/
 SAY 'ENTER DATASET NAME'
 PULL DSN
 SYSDSN("'"DSN"'")
 "LISTDS '"DSN"' MEMBERS"



I am not 100% sure please try anyways.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1544
Location: Andromeda Galaxy

PostPosted: Wed Jun 13, 2007 12:19 pm    Post subject:
Reply with quote

Teethu thomas,

This is a better code than previous.

Code:

/*REXX*/
SAY 'Enter a Data Set Name'
PARSE UPPER PULL dsname
IF SYSDSN(dsname) ?= 'OK' THEN DO
say 'DATASET NAME:'dsname
"LISTDS '"DSNAME"' MEMBERS"
RETURN
END


Hope this helps.
Back to top
View user's profile Send private message
teethu thomas

New User


Joined: 17 May 2007
Posts: 24
Location: India

PostPosted: Wed Jun 13, 2007 12:20 pm    Post subject: Re: How to read all the members in a PDS
Reply with quote

Thanx , it is working
Back to top
View user's profile Send private message
harishch_ch

New User


Joined: 07 Jan 2008
Posts: 27
Location: bangalore

PostPosted: Tue Apr 22, 2008 6:42 pm    Post subject: Reply to: How to read all the members in a PDS
Reply with quote

Can i assume that the PDS is copied to a PS file from the above REXX code?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue Apr 22, 2008 8:20 pm    Post subject: Re: Reply to: How to read all the members in a PDS
Reply with quote

harishch_ch wrote:
Can i assume that the PDS is copied to a PS file from the above REXX code?


You could, but your assumption would be incorrect. All those programs do is create a list of the members of a PDS.

Your process would have to:

- Create the member list (as shown above).
- Allocate the PDS and member.
- Read each record, and write to the output PS dataset.
- Allocate the PDS and next member.
- Read and write, and so on for all of the members.
Back to top
View user's profile Send private message
satishstar
Currently Banned

New User


Joined: 14 Mar 2005
Posts: 15

PostPosted: Wed Apr 23, 2008 2:57 pm    Post subject: How get all the members into a PS.....
Reply with quote

Hi,

/*REXX*/
SAY 'ENTER A DATA SET NAME'
PARSE UPPER PULL DSNAME
SAY 'DATASET NAME:'DSNAME
"LISTDS '"DSNAME"' MEMBERS"
RETURN
END

Using the above code i got all the members of PDS to the TSO screen,but my requirement is that i want to have all the members of the PDS written into a PS line by line like below :-

--MEMBERS--
ADD
COMS
LINESPGM
MEMBERS
PANEL2
PASS
REXXPGM
REXXREPL
RPT805TS
RPT805TZ
SATGUDTS
SATSHGUD
SCREEN1
SUBROUT
TRACE

Plz let me know if any.

Thx,
satish
Back to top
View user's profile Send private message
teethu thomas

New User


Joined: 17 May 2007
Posts: 24
Location: India

PostPosted: Thu Apr 24, 2008 9:58 am    Post subject:
Reply with quote

You can use the OUTTRAP functionality to get the members into a stem and then write it into a sample output file. I have attached below a sample code for that.

Code:

/*REXX*/
A = OUTTRAP('TEMPVAR.')
"LISTDS '"DSNAME"' MEMBERS"
B = OUTTRAP('OFF')
"ALLOCATE DD(OUTPUT) DA('THEDSN') NEW
  SPACE(100 10) TRACKS DSORG(PS) LRECL(40) RECFM(F B)"
"EXECIO * DISKW OUTPUT(STEM TEMPVAR. FINIS"
"FREE DD(OUTPUT)"
EXIT
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Historical/statistical details for me... elixir1986 TSO/ISPF 13 Wed Aug 30, 2017 9:02 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Read of TDQ fails in LENGERR Tracy Hansen CICS 10 Wed Apr 05, 2017 12:10 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us