Victor Gil,
It is quite simple to verify the number of records and validate it against
the trailer record and if the record count match the return code is 0 and
if the count is off then the return code is set to 4.
I assumed that the trailer record is not counted as part of the record
count. If it is indeed counted then simply remove the ",START=0" on the
INREC statement.
Use the following JCL
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
A
B
C
D
RECS=00005
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(81:SEQNUM,5,ZD,START=0)
OUTFIL NULLOFL=RC4,
INCLUDE=(1,5,CH,EQ,C'RECS=',AND,
(06,5,ZD,EQ,81,5,ZD))
//*
The above job will end with RC=4 as there are only 4 records but the
trailer says 5 records.
Further if you have any questions please let me know
Thanks,
Kolusu
DFSORT Development
IBM Corporation
From: Victor Gil <[email protected]>
To: [email protected]
Date: 06/27/2016 12:04 PM
Subject: Verify record cound against the file trailer [by SORT?]
Sent by: IBM Mainframe Discussion List <[email protected]>
I am posting this for a co-worker - some of his flat files have trailing
records stating the total record counter, e.g.:
RECS=00567
The question is - what utility [I am guessing SORT should suffice] can he
use to verify the trailer counter against the actual number of records in
the file?
Thanks in advance!
-Victor-
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN