Posted: Tue May 31, 2011 2:59 am Post subject: Abend the job when trailer count is incorrect
Hi
My job is having 3 steps.
My input file is of FB type and (LRECL=300)having detail records and trailer record
Trailer record is like this
Code:
TRAILER-ID X(7)
RECORD-COUNT X(15)
FILLER X(278)
In the first step,
i want to abend the job if the RECORD-COUNT in trailer record is not correct(i.e not matching to the total no of detail records)
Note:- RECORD-COUNT is the number of detail records only(not the trailer record)
Please help me how to achieve this Using ICETOOL ?
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Tue May 31, 2011 5:40 am Post subject:
are you sure you want to abend the job?
will not a non-zero return-code function?
abends (real abends, not miss-used terminology)
take up a lot of resources,
that could otherwise be dedicated to processing. _________________ Dick Brenholtz
American living in Varel, Germany
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Tue May 31, 2011 10:39 am Post subject:
esaccy,
Use the following DFSORT JCL which will give you the desired results. I assumed that the count on the trailer record includes the trailer record itself. If not then change the inrec statement to INREC OVERLAY=(301:SEQNUM,15,ZD,START=0)
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
A
B
C
D
TRAILER 6
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
DEBUG ABEND
INREC OVERLAY=(301:SEQNUM,15,ZD)
OUTFIL NULLOFL=RC16,
INCLUDE=(1,7,CH,EQ,C'TRAILER',AND,(8,15,UFF,EQ,301,15,UFF))
//*
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