View previous topic :: View next topic
|
Author |
Message |
jchristdoss
New User
Joined: 30 Aug 2006 Posts: 4
|
|
|
|
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 |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
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 |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
(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 |
|
|
jchristdoss
New User
Joined: 30 Aug 2006 Posts: 4
|
|
|
|
Hi All
Thanks for all your quick replies..
now it is working..
Regards,
Christopher J |
|
Back to top |
|
|
ezhavendhan
New User
Joined: 27 Mar 2013 Posts: 11 Location: India
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
|