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
 

 

Need to empty records from PDS members but dont delete them

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Need to empty records from PDS members but dont delete them
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    Post subject:
Reply with quote

Hi,

Please refer this link

http://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    Post subject: Reply to: Need to empty records from PDS members but dont de
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: 401
Location: Mumbai

PostPosted: Thu Dec 10, 2009 12:42 pm    Post subject:
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    Post subject: Reply to: Need to empty records from PDS members but dont de
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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