Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to read the content of pds member one by

Status
Not open for further replies.

shuhaibk54

Technical User
Jun 12, 2012
18
IN
Hi Everyone here....

I need to write the rexx code for reading the content one by of pds member.for example, I have pds with member abctds.join.studen(list),I need to print the value one by one which are all present in the member 'list'.Can any one please help me out to find the solution.One other thing I am able to read the content from PS(see the below code).Please help me out to build the code for read the content of pds member .


Thanks,
Shu

/*REXX */
ADDRESS TSO
"ALLOC F(INFILE) DSN('ABC.CBD.ZKH') SHR REU"
"EXECIO * DISKR INFILE ( FINIS STEM MYFILE."
"FREE F(INFILE)"
I = 1
DO WHILE I <= MYFILE.0
SAY ' LINE ' I ' : ' MYFILE.I
I = I + 1
END
EXIT
 
A member of a PDS is just like a sequential dataset. You can use the same technique with a little finesse:

Code:
/*REXX */ 
ADDRESS TSO 
"ALLOC F(INFILE) DSN('[COLOR=red]abctds.join.studen(list)[/color]') SHR REU" 
"EXECIO * DISKR INFILE ( FINIS STEM MYFILE." 
"FREE F(INFILE)" 
I = 1 
DO WHILE i <= myfile.0 
   SAY " LINE " i " : " myfile.i
   i = i + 1 
END 
EXIT

One suggestion: Since you must use the single quote (') for dataset names, you should use the double-quote (") for literals. This will avoid confusion and make your code more readable. Then, if you use lower-case for variables, differentiating between 'literal' and 'variable' becomes almost automatic.

Frank Clarke
--America's source for adverse opinions since 1943.
 
Thanks for good advice and moment responce rexxhead!!

Its worked out ..I should have had thaught little tricky way before I post..

Any how I got good a good advice ....

Thanks,
Shuhaib
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top