I have a file lets say file1 which contains n numbers of records, and the bottom record of file contains the record count of file, but sometime the record count i get is wrong with actual record count.
here in above file last TRAILER record contains the record count which start from 19th position here it is 00101869 but sometime this record count is not true I want to do validation of this scenario here and check the whether the actual record count is matching with the trailer record count mentioned in file1.
What i have done tried:
i extracted the actual record count of the file in a ps data set by removing header and trailer record. ps data set looks like below.
Below Ps file contains actual record count having LRCL 2003
Now I want to see whether the count in above file is matching with record count in TRAILER record in file1 which start from position 19th and length we dnt know .
is it achievable through sorting here It looks simple but join keys required fixed length field to join two fields but here we don't know the length of record count in File1 we only know its starting position which is 19th in TRAILER record of the file1. Any hint or any way to do so..? depending upon the record count is correct or not i need to take decisions further in my job(JCL)
SYNCSORT FOR Z/OS 3.1.4.0R U.S. PATENTS: 4210961, 5117495 (C
z/OS 2.4.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 03CD7, MODEL 8561 605
SYSIN :
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(2004:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,1,CH,EQ,C'T')
*
OVERLAY=(2004:2004,8,ZD,SUB,+2,EDIT=(TTTTTTTT)))
*
OUTFIL INCLUDE=(1,1,CH,EQ,C'T',AND,19,8,ZD,EQ,2004,8,ZD)
WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER268A INREC STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
*********************
*********** END OF DATA *********************
I know it is something related to my include statement i have trailer record which start from T that is what i am looking for not sure where i am missing the things here. any hepl here i tried many times and then i posted here.
i have another way of solving this but this is one step solution thats why curios for this way.
Thanks everyone, I missed the, now it is working fine. I have one small question here. If we have multiple files to validate for the record count, is it possible to achieve it on one single step...?
Using multiple steps, we can do that but looking for a single step to validate any hint appreciated here.
How many datasets are we talking about ? Is it the same record layout ? If you would want to do one size fits all then follow Joerg’s suggestion to use proc and repeat as needed by overriding the datasets each time .
Thanks everyone, I missed the, now it is working fine. I have one small question here. If we have multiple files to validate for the record count, is it possible to achieve it on one single step...?
Using multiple steps, we can do that but looking for a single step to validate any hint appreciated here.
Try to concatenate all datasets under one //SORTIN DD, and then process them as GROUPS of a single dataset.
Thanks everyone, I missed the, now it is working fine. I have one small question here. If we have multiple files to validate for the record count, is it possible to achieve it on one single step...?
Using multiple steps, we can do that but looking for a single step to validate any hint appreciated here.
Try to concatenate all datasets under one //SORTIN DD, and then process them as GROUPS of a single dataset.
I have prepared a sort card and I am just using that sort of card in all the steps.
while working on requirement i came across we receive data set sometimes where we don't have any TRAILER string at the end of the file, still we need to validate the record count.
input file looks like below:
record lenght is 150.
Code:
007083 5405247141681072 M96672024-04-01DSLN+0000
007084 5153552558204006 M96692024-04-01DSLN+0000
007085 90008547482024-04-01000007083
****** **************************** Bottom of Data ***
7083 is the record count and now i need to validate the record count here.
It just now i am trying to identify the last record but not able to because there is no specific string in last record to identify it. Could you give any hint here. do i need to add a string here at last record to achive this..?