IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to empty records from PDS members but dont delete them


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
toton420

New User


Joined: 09 Dec 2009
Posts: 3
Location: kolkata

PostPosted: Wed Dec 09, 2009 10:45 am
Reply with quote

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
View user's profile Send private message
deepthimadhu

New User


Joined: 03 Mar 2009
Posts: 12
Location: Trivandrum

PostPosted: Wed Dec 09, 2009 11:14 am
Reply with quote

Hi,

Please refer this link

www.ibmmainframes.com/about39784.html
Back to top
View user's profile Send private message
toton420

New User


Joined: 09 Dec 2009
Posts: 3
Location: kolkata

PostPosted: Thu Dec 10, 2009 11:53 am
Reply with quote

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
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Dec 10, 2009 12:42 pm
Reply with quote

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
View user's profile Send private message
toton420

New User


Joined: 09 Dec 2009
Posts: 3
Location: kolkata

PostPosted: Thu Dec 10, 2009 3:15 pm
Reply with quote

It works !!perfect!! thanks so much to you all.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top