Monday, September 26, 2011

VSAM: Delete all the records in a KSDS file thru JCL


The below simple job will delete all records from a KSDS file


//STEP1  EXEC PGM=IDCAMS
//SYSIN DD *
 ALTER RXSXX49.TSTS.IND REUSE
//SYSPRINT DD SYSOUT=*
//*
//STEP2  EXEC PGM=IDCAMS
//DD1 DD DUMMY
//DD2 DD DSN=RXSXX49.TSTS.IND,DISP=OLD
//SYSIN DD *
 REPRO INFILE(DD1) -
 OUTFILE(DD2) REUSE
//SYSPRINT DD SYSOUT=*
//*
//STEP3  EXEC PGM=IDCAMS
//SYSIN DD *
 ALTER RXSXX49.TSTS.IND NOREUSE
//*

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.