Page 1 of 1

How to empty a member in a PDS

PostPosted: Mon Jan 23, 2012 8:16 pm
by JorenWillems
Hi

I want to erase the content of a member in a PDS. Now, I use the following:

AAD0     SORT                         
*                                     
SORTIN   FILE  NAME=JORE0001,MODE=I   
SORTOUT  FILE  NAME=JORE0002,MODE=O   
*                                     
SYSIN    DATA  *                     
 SORT FIELDS=COPY                     
OMIT COND=ALL                   
         DATAEND                     
*                                     
SYSOUT   REPORT SYSOUT=*             
SYSPRINT REPORT SYSOUT=*   


Is there a better way to do this ?

Re: How to empty a member in a PDS

PostPosted: Mon Jan 23, 2012 8:27 pm
by enrico-sorichetti
useless complication
why not use something simple like

//IEB     EXEC PGM=IEBGENER                                             
//SYSIN     DD DUMMY                                                   
//SYSPRINT  DD SYSOUT=*                                                 
//SYSUT1    DD DUMMY,DCB=(RECFM=FB,LRECL=80)                           
//SYSUT2    DD DISP=SHR,DSN=<your pds>(<your member>)         


modify the SYSUT1 DCB according to the DCB of <Your pds>

Re: How to empty a member in a PDS

PostPosted: Mon Jan 23, 2012 9:16 pm
by steve-myers
What is your real purpose here? This is simpler and faster than the previous "solutions."
//A       EXEC PGM=IKJEFT01,
// PARM='DELETE ''DATASET(MEMBER)'''
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  DUMMY
None of the solutions presented so far (including my solution) will prevent the member from being brought back by PDS "undelete" programs. The only way to prevent that is to "compress" the PDS after you have deleted the member as in my solution or replaced the member with a null member as in the previous "solutions," or to use a PDSE, which does not have a method to "undelete" a member.

Re: How to empty a member in a PDS

PostPosted: Tue Jan 24, 2012 12:55 pm
by JorenWillems
Stece-myers. I don't want to 'delete' the record, I want to erase the content of it... Make it empty.

Re: How to empty a member in a PDS

PostPosted: Tue Jan 24, 2012 1:02 pm
by BillyBoyo
The solutions provide should do that. What Steve Myers is pointing out is that if you want a "security delete" of a member (where you can't get the data back afterwards), don't rely directly on these.

Have you tried the solutions? What problems do you feel they presented?

Re: How to empty a member in a PDS

PostPosted: Tue Jan 24, 2012 2:07 pm
by JorenWillems
Allright! The method of enrico-sorichetti works fine!
Thank you guys