MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to empty a file without deleting it?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
prog_mario
Beginner


Joined: 08 Sep 2007
Posts: 86
Topics: 27

PostPosted: Tue Sep 13, 2011 6:43 am    Post subject: How to empty a file without deleting it? Reply with quote

Hi everybody, I have a job step in which I need to delete the content of da dataset to let it empty.
Is it possible to do that using IDCAMS or IEFBR14?
_________________
The more I learn, the more I want to learn.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Sep 13, 2011 10:20 am    Post subject: Reply with quote

prog_mario,

You can copy a dummy file on to your file to empty out the contents. You can use IDCAMS , SORT , rexx,....

ex:

Code:
             
//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD DUMMY,DCB=(LRECL=nnn,RECFM=FB)           
//SORTOUT  DD DSN=Your files that needs to be emptied,DISP=SHR
//SYSIN    DD *                                         
  OPTION COPY                                           
//*


or

Code:

//STEP0100 EXEC PGM=IDCAMS                             
//SYSPRINT DD SYSOUT=*                                 
//IN       DD DUMMY,DCB=(LRECL=nnn,RECFM=FB)           
//OUT      DD DSN=Your files that needs to be emptied,DISP=SHR
//SYSIN    DD *                                         
  REPRO INFILE(IN) OUTFILE(OUT)                         
//*



For more examples check this topic

http://www.mvsforums.com/helpboards/viewtopic.php?t=2729&highlight=eof
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group