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
 

 

how to list out all the members of a particular PDS by using

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

New User


Joined: 30 Aug 2006
Posts: 4

PostPosted: Thu Sep 14, 2006 7:22 pm    Post subject: how to list out all the members of a particular PDS by using
Reply with quote

Hi All,

I want to write all the members of a particular PDS into another PS.
is it possible in REXX since i am new to this language.
if so can i get the pseudo code for this.
it can be in REXX or ISPF or clist....

Thanks In Advance,
Christpoher J
Back to top
View user's profile Send private message

cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Sep 14, 2006 7:38 pm    Post subject: Re: how to list out all the members of a particular PDS by u
Reply with quote

Go into option 3.1 (Library).

Next to Data Set Name enter your PDS with single quotes.

Place an "X" (Print Index Listing) next to Option and press enter to print an index listing.

The system will say: INDEX PRINTED

Enter 'HELP' next to Option and press enter.

The system will show the dataset it placed your index in.

Enter 'LIST' next to Option and press enter.

Select option 3.- Keep existing data set and continue with new data set.

Go back into option 3.4 and DISPLAY your USERID next to dsname level.

Browse or edit your USERID.SPF?.LIST dataset to see the PDS members
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Thu Sep 14, 2006 9:20 pm    Post subject: Re: how to list out all the members of a particular PDS by u
Reply with quote

There's no REXX function that deals with PDS's.

On top of the suggestion from cpuhawg, there's also the TSO LISTDS command and the ISPF LMMLIST service. You can also, as in other languages, read the PDS directory block:
Code:

/* REXX */                                                           
"ALLOC DD(pds) DA('mypds') SHR REU RECFM(F) DSORG(PS) LRECL(256) BLKSIZE(256)"
"EXECIO * DISKR pds (STEM dir. FINIS"                                 
Do blk = 1 To dir.0                                                   
  usedbytes = C2D(Substr(dir.blk,1,2))                               
  index = 3 /* skip past used bytes */                               
  Do While index < usedbytes                                         
    If Substr(dir.blk,index,8) = 'FFFFFFFFFFFFFFFF'x Then Leave       
    pds2name = Substr(dir.blk,index,8) /* member name */             
    Say pds2name                                                     
    index = index + 11 /* skip past name and ttr */                   
    pds2indc = Substr(dir.blk,index,1)                               
    len = Bitand(pds2indc,'1F'x) /* isolate user data length */       
    userdata = C2D(len) * 2 /* halfwords to bytes */                 
    index = index + userdata + 1 /* skip past user data */           
  End                                                                 
End                                                                   
"FREE DD(pds)"                                                       
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Thu Sep 14, 2006 9:31 pm    Post subject:
Reply with quote

Try this:
Code:
/**/
X = OUTTRAP("MEMLST.")
"LISTDS 'mypds' MEMBERS"
X = OUTTRAP("OFF")
DO I = 1 TO MEMLST.0
  SAY MEMLST.I
END

In your rexx you will have to ignore everything up to the "--MEMBERS--" line
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Thu Sep 14, 2006 9:56 pm    Post subject:
Reply with quote

(Sorry, just reread the question). The full code could be:
Code:
/* REXX */                                 
mypds = 'z1i.spf.clist'                   
outfile = 'z1i.temp.work1'                 
                                           
X = OUTTRAP("MEMLST.")                     
"LISTDS '"mypds"' MEMBERS"                 
X = OUTTRAP("OFF")                         
                                           
/* bypass until MEMBERS found */           
Do I=1                                     
   If MEMLST.I = "--MEMBERS--" Then Leave 
End                                       
                                           
/* start real process here */             
"ALLOC FI(FOUT) DA('"outfile"') SHR"         /* allocate output file */
Do I = I+1 TO MEMLST.0                     
   inpname = mypds"("strip(MEMLST.I)")"      /* make input name */
   "ALLOC FI(FINP) DA('"inpname"') SHR"      /* allocate input member */
   "EXECIO * DISKR FINP (FINIS STEM lines."  /* read input */
   "EXECIO * DISKW FOUT (STEM lines."        /* append to output */
   "FREE FI(FINP)"                           /* release input member */
End                                       
"FREE FI(FOUT)"
Back to top
View user's profile Send private message
jchristdoss

New User


Joined: 30 Aug 2006
Posts: 4

PostPosted: Fri Sep 15, 2006 6:53 pm    Post subject:
Reply with quote

Hi All

Thanks for all your quick replies..
now it is working..

Regards,
Christopher J
Back to top
View user's profile Send private message
ezhavendhan

New User


Joined: 27 Mar 2013
Posts: 11
Location: India

PostPosted: Tue Jun 11, 2013 6:15 pm    Post subject: Reply to: how to list out all the members of a particular PD
Reply with quote

Marso,

Your code works fine with the input as PS. I want to know the possibility to write to another PDS member. Kindly enlight on this.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


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

PostPosted: Tue Jun 11, 2013 6:20 pm    Post subject:
Reply with quote

Never reactivate the old thread and for queries please start a new topic and explain better with what is the requirement , what is expected and what is being done so far ..

So it would help others and you to narrow down on the solution
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Tue Jun 11, 2013 6:29 pm    Post subject: Re: Reply to: how to list out all the members of a particula
Reply with quote

ezhavendhan wrote:
Marso,

Your code works fine with the input as PS. I want to know the possibility to write to another PDS member. Kindly enlight on this.


the INPUT is a PDS and the OUTPUT is a PS.

all you would have to do is change the outfile value and the modify the FOUT ALLOC command.
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 member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts reorder screeNS using SWAP LIST? mrsidhu12 TSO/ISPF 5 Thu Sep 01, 2016 2:19 pm


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