Tuesday, December 6, 2011

IDCAMS REPRO for an empty ESDS file fails - Solution

Problem
An ESDS is backed up using IDCAMS REPRO. However, this ESDS being empty, the backup job abends with RC 12. I assumed that if we used SORT instead, it might return RC 0, but the SORT job abended. Is it possible (using IDCAMS or SORT or any other means) to get an RC of 00, or 04, if the ESDS is empty ?


Solution
It is possible to get an RC of 00 using SORT Even if the ESDS is empty. 

In the PARM parameter we have to give 'VSAMEMT=YES'.

The code will look like the following


//STEP010  EXEC PGM=SORT,PARM='VSAMEMT=YES'
//SORTIN   DD DSN=XXXX.XXXX.XXXX.ESDF,DISP=OLD
//SORTOUT  DD DSN=XXXX.XXXX.XXXX.OUT,DISP=(NEW,CATLG,DELETE),
//         SPACE=(TRK,(1,1),RLSE),LRECL=80,RECFM=FB
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*

No comments:

Post a Comment

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