View previous topic :: View next topic
|
Author |
Message |
toton420
New User
Joined: 09 Dec 2009 Posts: 3 Location: kolkata
|
|
|
|
Need to empty records from PDS members but do not delete them. Say there is a PDS library (TEST.JOBPDS)with 5 members JCL1,JCL2,JCL3,JCL4 and JCL5. I need to remove the contents of each of these members so that the members JCL1,JCL2,JCL3,JCL4 and JCL5 are now empty. But they should themselves remain in the library and show up. |
|
Back to top |
|
|
deepthimadhu
New User
Joined: 03 Mar 2009 Posts: 12 Location: Trivandrum
|
|
Back to top |
|
|
toton420
New User
Joined: 09 Dec 2009 Posts: 3 Location: kolkata
|
|
|
|
Thanks for the IDCAMS utility. But this IDCAMS instruction below will delete records from 1 member only.
//JS00100 EXEC PGM=IDCAMS
//DDDMMY DD DUMMY
//DDOUT DD DSN=...input file
// DISP=SHR
//SYSIN DD *
REPRO IFILE(DDDMMY) OFILE(DDOUT)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*
I have over 1700 members in the PDS and I want each of them to be empty of all records. But they must be present after the utlility is run. Cn you help? |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
Very slow but effective:
Code: |
/*Rexx example to empty all pds members */
dsn="YOUR.UNQUALIFIED.DATA.SET.NAME"
Say "Empty all members in '" || dsn ||"'? (Y/N)"
Pull ans
If substr(ans,1,1) = 'Y' Then
Do
"ALLOC F(OUT) SHR DA('"||dsn||"') REUSE"
xx=outtrap('STEM.')
"LISTD '" || dsn || "' MEM"
xx=outtrap('OFF')
Say "Emptying" (stem.0 - 6) "members from '" || dsn || "'..."
Do a= 7 to stem.0
"ALLOC F(OUT) OLD DA('"||dsn||"("||strip(stem.a)||")') REUSE"
If rc=0 Then
"EXECIO 0 DISKW OUT (OPEN FINIS"
End
"FREE F(OUT)"
End
else
say 'Canceled' |
For faster results, modify to get member names, delete and recreate original data set, then write empty members. For fastest results, modify to get member names, generate IEBUPDTE ADD statements, recreate the data set and call IEBUPDTE to create empty members. (last two suggestions untested, not sure if IEBUPDTE creates empty members) |
|
Back to top |
|
|
toton420
New User
Joined: 09 Dec 2009 Posts: 3 Location: kolkata
|
|
|
|
It works !!perfect!! thanks so much to you all. |
|
Back to top |
|
|
|