Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Can you show your full sysout from the step with the NULLOFL, please? Was there a reason not to include the "second step" as the "main task" in the JOINKEYS?
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Ramsri,
I don't suppose you mean: "NULLOFL will set the RC to 4 or 12 when no data is in the OUTFIL group. I have INCLUDEd one record and got a zero RC".
How many records are you likely to compare in this way? Do you need to know which has failed (if there are hundreds, it could save someone a lot of time, if there are three, not really, unless it is for a late-night call)?
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Ramsri,
Any update on this, or is it superseded by your new topic?
This will work if you have trailers on the files. I have a MERGE solution if you have headers. Headers and/or trailers can be easily added provided as input to your processing.
SYNCSORT FOR Z/OS 1.3.2.2R
SYSIN :
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(40:9,4,ZD,SUB,21,4,ZD,TO=ZD,LENGTH=1)),
IFTHEN=(WHEN=(40,1,ZD,GT,+1),
OVERLAY=(45:C'DIFF NOT ONE'))
OUTFIL INCLUDE=(45,4,CH,EQ,C'DIFF'),NULLOFL=RC4
WER276B SYSDIAG= 6605, 665257, 665257, 1151625
WER164B 6,904K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,118,276 BYTES USED
WER146B 12K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 24; BLKSIZE= 27984
WER257I INREC RECORD LENGTH = 56
WER238I POTENTIALLY INEFFICIENT USE OF INREC
WER110I SORTOUT : RECFM=FB ; LRECL= 56; BLKSIZE= 56
WER410B 5,876K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 102,604 BYTES USED
WER405I SORTOUT : DATA RECORDS OUT 1; TOTAL RECORDS OUT 1
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B SORTIN : EXCP'S=1,UNIT=3390,DEV=3957,CHP=(2A3C343F4046,1),VOL=SYS120
WER416B OUTFIL WAS USED FOR SORTOUT
WER054I RCD IN 3, OUT 3
WER169I RELEASE 1.3 BATCH 0506 TPF LEVEL 2.2
Try to include that in the after your JOINKEYS/REFORMAT statement. Include a DUMMY DD for CHKOUT. Concatenate a record (or just type for testing) which says DUMMY starting in position one. You'll maybe need to change positions, as I used the following data.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Here's another take on it, using MERGE. The MERGE is done on a generated sequence number, so that records are taken from the first file, then the second, then the first, then the second, etc. When an out-of-range situation is encountered, the sequence number key is blattered "low", and the MERGE then fails with RC=16, otherwise completes. Tested with DFSORT and using SYSOUT=* for SORTOUT, but I assume the DD DUMMY works :-)
I forgot to mention that th EQ,B'.......1' and 0 are testing for oddness or evenness of the number (stole that from a previous post I ran across the other day). In extending the sequence number just in case you had scrillions of counts to check, I messed the position of the final digit :-)
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Ramsri,
Did you ever notice the subject of your post?
Plus:
Quote:
I have to compare counts from two files and if the difference is more than 1 then need to issue RC=8 or 16 using SORT or File-Aid. Is it possible?
You got your 16, and now you are complaining :-) ?
Look at the first "RECORD4" records, one with a count of one, one with a count of five. Difference is four. Bigger than the difference of two I used for my testing, so the code DELIBERATELY causes the keys to be out-of-sequence, which causes MERGE to issue the RC=16.
Hi Dick,
Sorry, but Ramsri has deluded everyone into thinking the results are wrong :-)
ok Bill.......I understood it now......I kept the same data in 01 and 02 and got MAXCC=0 and ran again with earlier data and got U0016.....earlier I was expecting to see MAXCC=16
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
ramsri wrote:
earlier I was expecting to see MAXCC=16
Thanks a lot for your time and help.
Me too :-)
Now go and fix-up your JOINKEYS version with trailers included, The trailers will give you a point at which you can say "ah, I have a dodgy count, now I mustn't write one record to a dummy file, or, I don't have a dodgy count, so I must write one record to a dummy file" and then the empty/non-empty OUTFIL file will get a non-zero RC (four or 12, sorry about that).