Hi Sri,
I am a colleague of Victor's, and the initial problem was not stated quite
correctly. The input file is RECFM=VB, and the trailer record is identified by
X'FF' in the first data position. The record count to be checked in the
trailer record is at positions 145-155 (11 digits, ZD). The count in the
trailer record does not include either the header record (X'00' in the first
position) nor the trailer record, so the count in the trailer record should be
the actual record count minus 2. The desired result is to check the trailer
count versus the actual data record count and set RC=4 if they do not agree.
Unfortunately we do not actually have access to DFSORT any more, only Syncsort.
May I ask you to please verify for me that if we were using DFSORT that the
control cards below would do what we wish? If so then I can go to our Systems
Programmers to open a ticket with Syncsort for assistance in verifying the
operation of NULLOFL=RC4 in their product.
When I use these control cards with Syncsort, the output file is null (has no
records) but Syncsort is not setting RC=4, so I will go to them for support if
the control cards I am using should give RC=4.
OPTION COPY
* ADD SEQNUM BETWEEN RDW AND DATA.
INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,11,ZD,16:5)),
* USE SEQNUM-2 TO PUT COUNT OF DATA RECORDS IN POS 20 OF
* LAST RECORD (IDENTIFIED BY X'FF').
IFTHEN=(WHEN=(16,1,BI,EQ,X'FF'),
OVERLAY=(020:5,11,ZD,SUB,+2,M11,LENGTH=11))
OUTFIL NULLOFL=RC4,
INCLUDE=(016,1,BI,EQ,X'FF',AND,
(160,11,ZD,EQ,20,11,ZD)),
BUILD=(1,4,5:5)
Thank you for your generous and expert assistance on this forum.
Peter
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Sri h Kolusu
Sent: Monday, June 27, 2016 3:18 PM
To: [email protected]
Subject: Re: Verify record cound against the file trailer [by SORT?]
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
--
This message and any attachments are intended only for the use of the addressee
and may contain information that is privileged and confidential. If the reader
of the message is not the intended recipient or an authorized representative of
the intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication
in error, please notify us immediately by e-mail and delete the message and any
attachments from your system.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN