Compare counts and abend by 10% difference

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
jself
Posts: 10
Joined: Thu Mar 19, 2015 7:18 pm
Skillset: cobol, jcl, syncsort, db2
Referer: internet

Compare counts and abend by 10% difference

Postby jself » Thu Mar 19, 2015 7:42 pm

Hi,
I need some advice on syncsort. I have two files (FILEA - main, FILEB - new). These are bank files with router numbers on them. We are trying to avoid a problem where FILEB comes in bad and only has 500 records and should have had 20,000 records. The information should be pretty much the same but FILEB might have say 100 more records or 100 less records. We would like to compare FILEA - 20,000 RECORDS, FILEB 20,002 RECORDS. Abend if there are more than say 1% difference in FILEA and FILEB.
Anyone have an example of this code?
Thanks for the help.

jself
Posts: 10
Joined: Thu Mar 19, 2015 7:18 pm
Skillset: cobol, jcl, syncsort, db2
Referer: internet

Re: Compare counts and abend by 1% difference

Postby jself » Thu Mar 19, 2015 7:55 pm

I have the code to do the compare and get the differences in the two files.
I really just need to be able to count FILEA & FILEB and do the calculation.

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

Re: Compare counts and abend by 10% difference

Postby BillyBoyo » Thu Mar 19, 2015 9:12 pm

Can you post the code you have, please?

jself
Posts: 10
Joined: Thu Mar 19, 2015 7:18 pm
Skillset: cobol, jcl, syncsort, db2
Referer: internet

Re: Compare counts and abend by 10% difference

Postby jself » Thu Mar 19, 2015 9:36 pm

Here is what I have so far.
SORTJNF1
00000
11111
22222
33333
44444
55555
66666
77777
88888
99999

SORTFNF2
00000
11111
22222
33333
44444
55555
66666
77777

000021 //SORT03 EXEC PGM=SORT
000022 //SYSUDUMP DD SYSOUT=Y
000023 //SYSOUT DD SYSOUT=*
000024 //SORTJNF1 DD DSN=TSO####.KEEP.KEEP.SORTJNF1,
000025 // DISP=SHR
000026 //SORTJNF2 DD DSN=TSO####.KEEP.KEEP.SORTJNF2,
000027 // DISP=SHR
000028 //SORTOUT DD DSN=LIFET.####.#030.JUNK.JUNK,
000029 // DISP=(NEW,CATLG,DELETE)
000031 //SYSIN DD *
000032 JOINKEYS FILES=F1,FIELDS=(1,5,A)
000033 JOINKEYS FILES=F2,FIELDS=(1,5,A)
000034 JOIN UNPAIRED,ONLY
000035 REFORMAT FIELDS=(F1:1,5)
000036 SORT FIELDS=COPY
000037 /*

Thank you for reviewing.

I started another step that reads in the ouput from the above and its as follows.
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('NUMBER OF RECORDS ARE:',COUNT=(M11,LENGTH=8))

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

Re: Compare counts and abend by 10% difference

Postby BillyBoyo » Thu Mar 19, 2015 10:00 pm

You don't need a second step. There is a "Main Task" for JOINKEYS, which gives you a full run at anything you can normally have in a SORT/MERGE/COPY step, just with the result of the JOINKEYS as input.

You are counting the mismatches, but you won't be able to tell the percentage if you don't count the originals as well, or do you have a count already?

jself
Posts: 10
Joined: Thu Mar 19, 2015 7:18 pm
Skillset: cobol, jcl, syncsort, db2
Referer: internet

Re: Compare counts and abend by 10% difference

Postby jself » Thu Mar 19, 2015 10:13 pm

No, I don't have the count for the originals or the new file. Some how I need to count the 10 records from the original file
10 records * 10 percent = 1 record that is allowed to be different.
Join shows 2 differences > 1 allowed then abend.

jself
Posts: 10
Joined: Thu Mar 19, 2015 7:18 pm
Skillset: cobol, jcl, syncsort, db2
Referer: internet

Re: Compare counts and abend by 10% difference

Postby jself » Thu Mar 19, 2015 11:55 pm

To make things easier I might be able to convince others to use a set amount instead of calculating the difference.
so, in above example still use the join to get the differences.
then count the differences.
2 records > hard coded amount of differences allowed 1 ; then abend.


  • Similar Topics
    Replies
    Views
    Last post