My requirement is to check the COUNT of the record of the i/p file and if the file is EMPTY write a message in the same file.
I've achieved that using the below code. But it is throwing return code 12 when the file is NOT EMPTY. I read the manual and understood that it works the same way.
We are not expecting the max cc as 12 to pass to down stream steps, so can someone please give some other idea or give someway to reset the code to zero even in case of NOT EMPTY?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
girishbs13,
Your job returns RC=4 or RC=0. Amar wanted RC=0 in both cases so your job doesn't do what he asked for.
Amar,
DFSORT does NOT support a COPY application using the same file for input and output. You could end up losing your file.
Here's a DFSORT job that will do what you asked for without the possibility of losing your input data set. Note that step S1 uses DISP=SHR for the input file and step S2 uses DISP=MOD for the input filet. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed for other attributes.