Page 1 of 1

Compare 2 files having each file with 1 rec of record count

PostPosted: Wed Jul 10, 2019 6:18 am
by cool29
Hi All,

I have to compare 2 files which are having each record counts of 9 digits.
file1 count i am calculating at end my while posting to requests message to outside application. file2 count is coming from outside application with direct count how many they processed.

i searched the web site and gone thorough multiple posting. but in all cases file with total records passing to sort and calculating the counts. in my case direct count coming in file.

Infile1 : 80 bytes file size
000088888 - Count size - 9 bytes
infile2 : 80 bytes file size
000099999 - Count size - 9 bytes

There are multiple condition to check
if file1 count > file2 count - means all requests are not processed. - if difference greater than some 10-15 I want RC 16 and will catch RC in next step of JOB to abend.
if file1 count = file2 count - no issue so RC=0
if file1 count < FIle2 count - duplicate responses - If difference greater than 10-15 than RC= 8

Re: Compare 2 files having each file with 1 rec of record co

PostPosted: Wed Jul 10, 2019 3:01 pm
by NicC
While your requirement is not clear it certainly cannot be done by JCL. JCL simply lets the operating system know that you want to execute one or more programs and the resources required to do so. Individual programs are controlled by their statements and, possibly, program control statements e.g. SYSIN data to DFSORT. And the data is kept in DATA SETS not files (hence DSN= (DataSetName=)).

The way you worded your requirement makes it sound like the first program gets some input, formats it into a message for a second program which executes it. When all input to program 1 is processed, and the last message sent, program 1 creates a total record. Program 1 then waaits for program 2 to finish processing all the messages after which it sends a message back to program 1 with a record count. Program 1 then terminates with a relevant return code.

This is not achievable in a batch system.

Why not simply have program 1 create a dataset with all the messages in it and a record with the count of messages passed. Program 2 can then check that it has processed the correct number of messages and terminate accordingly.