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
 
How to clear the data in a Dataset?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
muralialla

New User


Joined: 03 Jan 2007
Posts: 11
Location: Chennai

PostPosted: Thu Jan 11, 2007 7:07 pm    Post subject: How to clear the data in a Dataset?
Reply with quote

Hi all

I need to re use a Dataset(PDS/PS) everytime. How to clear the data.....is there any direct command to do that?
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Thu Jan 11, 2007 7:20 pm    Post subject: Re: How to clear the data in a Dataset?
Reply with quote

Personally, I use a DFSORT step in the job. In REXX, you could just open the output DD and write nothing:

"EXECIO 0 DISKW ddname (FINIS"
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Fri Jan 12, 2007 2:18 pm    Post subject: RE: How to clear the data in a Dataset?
Reply with quote

Hi,
use this step for that,

Code:

//S1    EXEC  PGM=ICEMAN                                   
//SYSOUT    DD  SYSOUT=*                                   
//SORTIN DD DSN=USZ9997.PREBIND.ZARC.G0040V00,DISP=SHR     
//SORTOUT DD DSN=USZ9997.PREBIND.ZARC.TEST,DISP=SHR     
//SYSIN    DD    *                                         
    OPTION COPY                                           
    OMIT COND=ALL                                         
/*                                                       
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jan 13, 2007 12:52 am    Post subject:
Reply with quote

Hello,

If you want to re-use the file by overwriting it in an application program, you can specify DISP=OLD in the JCL. An OPEN OUTPUT will create "new" output in the existing file.

One caution is that you may run out of the "old" space and abend when the "new" data is larger than the "old" data.

Do you want to reuse the file due to a catalog problem? If so, you can add an IEFBR14 step before the "catalog" step that will unconditonally delete the file. Here's an example of what i just described:
Code:
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//HSKP     EXEC PGM=IEFBR14                                             
//D1       DD DSN=MS.RDS.NEWRATE.M1006,DISP=(MOD,DELETE),UNIT=SYSDA,   
//            SPACE=(TRK,0)                                             
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//MCH1     EXEC PGM=DSCHMCH1                                           
//CAP      DD DSN=MS.RDS.CAP1006,DISP=OLD                               
//ELIG     DD DSN=MS.RDS.ELIG1006.SORTED,DISP=OLD                       
//NEWRATE  DD DSN=MS.RDS.NEWRATE.M1006,DISP=(,CATLG,DELETE),UNIT=SYSDA,
//            DCB=(RECFM=FB,BLKSIZE=0,LRECL=80),                       
//            SPACE=(CYL,(50,10),RLSE)                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 


The housekeeping step (HSKP) ensures that the file does not exist. That DISP parameter will delete the file if it exists or, create it then delete it if is does not already exist.

The second step (MCH1) runs a program that creates the file.

Please let me know if you'd like any other info.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

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