Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us