Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

 issue RC=8 or RC=16 if count diff > 2 Goto page 1, 2  Next
Author Message
ramsri

Active User

Joined: 18 Oct 2008
Posts: 380
Location: India

Posted: Fri Nov 23, 2012 7:44 pm    Post subject: issue RC=8 or RC=16 if count diff > 2

Hi,

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?

Input-1:
 Code: RECORD1 2012 RECORD2 3458 RECORD3 1974

Input-2:
 Code: RECORD1 2010 RECORD2 3457 RECORD3 1973

In above, RECORD1 has difference in count as 2. How to get RC=8 or 16? Please help.

Thanks.

Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Fri Nov 23, 2012 7:56 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2 SyncSort manual handy? Have a look at OUTFIL and see if NULLOFL exists, or some other processing for no records on an OUTFIL group.
ramsri

Active User

Joined: 18 Oct 2008
Posts: 380
Location: India

 Posted: Sat Nov 24, 2012 9:41 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2 Ok....will give a try.
ramsri

Active User

Joined: 18 Oct 2008
Posts: 380
Location: India

Posted: Sun Nov 25, 2012 9:08 am    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2

Hi,

I tried below two step SORT solution (could not combine INREC with JOINKEYS) but to no avail It still ends with MAXCC=0000. and NULLOFL does not work.

1st step: Use JOINKEYS to bring pairs of records side by side from two files into a temp output file. Use temp file as input to 2nd step.

2nd step:
 Code: //SYSIN DD *                                                    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 NULLOFL=4,INCLUDE=(45,4,CH,EQ,C'DIFF')

Output:
 Code: ----+----1----+----2----+----3----+----4----+----5----+----6 RECORD1 2012RECORD1 2010               2    DIFF NOT ONE    RECORD2 3458RECORD2 3457               1                    RECORD3 1974RECORD3 1973               1

Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Sun Nov 25, 2012 2:19 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2 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?
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Sun Nov 25, 2012 2:31 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2 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)?
gcicchet

Senior Member

Joined: 28 Jul 2006
Posts: 1703
Location: Australia

 Posted: Mon Nov 26, 2012 2:57 am    Post subject: Hi, I would change LENGTH=1 to LENGTH=4, a 1 byte value for count difference will result in incorrect results. eg. a difference of 10 will result in 0 for LENGTH=1 Gerry
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Tue Nov 27, 2012 4:14 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2 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.
ramsri

Active User

Joined: 18 Oct 2008
Posts: 380
Location: India

Posted: Wed Nov 28, 2012 3:57 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2

Hi Bill,

Here is the SYSOUT:

 Code: 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

Thanks.
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Wed Nov 28, 2012 4:23 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2 Ramsri, There were other questions. What output are you expecting? Just the RC, or some indication of what didn't "get close" to matching?
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

Posted: Wed Nov 28, 2012 5:03 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2

Ramsri,

 Code: SORT FIELDS=COPY  INREC IFTHEN=(WHEN=INIT,                OVERLAY=(40:3,4,ZD,SUB,8,4,ZD,TO=ZD,LENGTH=4)),       IFTHEN=(WHEN=GROUP,BEGIN=(40,1,ZD,GT,+1),               PUSH=(45:1,1))  OUTFIL NULLOFL=RC4,         FNAMES=CHKOUT,         INCLUDE=(1,6,CH,EQ,C'DUMMY ',AND,45,1,CH,EQ,C' ')

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.
 Code: X-6839 6838 K-4987 4980 T-3312 3308 DUMMY

Result was RC=4. Tested with DFSORT.
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

Posted: Wed Nov 28, 2012 5:13 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2

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 :-)

 Code: //COUNTCHK EXEC PGM=SORT //SYSOUT   DD SYSOUT=* //SORTOUT  DD DUMMY //SYSIN    DD *   INREC IFTHEN=(WHEN=INIT,OVERLAY=(13:SEQNUM,7,ZD)),         IFTHEN=(WHEN=GROUP,BEGIN=(20,1,BI,EQ,B'.......1'),            PUSH=(21:1,12)),         IFTHEN=(WHEN=(1,5,CH,EQ,C'DUMMY'),OVERLAY=(1:1,1)),         IFTHEN=(WHEN=(20,1,BI,EQ,B'.......0'),            OVERLAY=(34:9,4,ZD,SUB,29,4,ZD,EDIT=(TTTT)),HIT=NEXT),         IFTHEN=(WHEN=(34,4,CH,GT,C'0001'),            OVERLAY=(13:X'00'))   MERGE FIELDS=(13,7,CH,A) //SORTIN01 DD * DUMMY RECORD1 2010 RECORD2 3458 RECORD3 1974 RECORD4 0001 RECORD1 2010 RECORD2 3458 RECORD3 1974 RECORD4 0001 RECORD1 2010 RECORD2 3458 RECORD3 1974 RECORD4 0001 RECORD1 2010 RECORD2 3458 RECORD3 1974 RECORD4 0001 //SORTIN02 DD * DUMMY RECORD1 2012 RECORD2 3457 RECORD3 1973 RECORD4 0005 RECORD1 2012 RECORD2 3457 RECORD3 1973 RECORD4 0005 RECORD1 2012 RECORD2 3457 RECORD3 1973 RECORD4 0005 RECORD1 2012 RECORD2 3457 RECORD3 1973 RECORD4 0005
ramsri

Active User

Joined: 18 Oct 2008
Posts: 380
Location: India

 Posted: Thu Nov 29, 2012 9:39 am    Post subject: Bill, I will try these ones and come back ......thanks for all the tips. Yes..I am looking to get RC4 or RC16 whenever a single wrong record is found.
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

Posted: Fri Nov 30, 2012 2:50 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2

Ramsri,

Sorry, bugged it up with a last minute change...

 Code: INREC IFTHEN=(WHEN=INIT,OVERLAY=(13:SEQNUM,7,ZD)),         IFTHEN=(WHEN=GROUP,BEGIN=(19,1,BI,EQ,B'.......1'),            PUSH=(21:1,12)),         IFTHEN=(WHEN=(1,5,CH,EQ,C'DUMMY'),OVERLAY=(1:1,1)),         IFTHEN=(WHEN=(19,1,BI,EQ,B'.......0'),            OVERLAY=(34:9,4,ZD,SUB,29,4,ZD,EDIT=(TTTT)),HIT=NEXT),         IFTHEN=(WHEN=(34,4,CH,GT,C'0002'),            OVERLAY=(13:X'00'))   MERGE FIELDS=(13,7,CH,A),NOEQUALS

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 :-)
ramsri

Active User

Joined: 18 Oct 2008
Posts: 380
Location: India

Posted: Thu Dec 06, 2012 8:25 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2

Hi Bill, I have ran the job as it is and it abend with U0016 ! Here is the SYSOUT:

 Code: SYSIN :                                                              INREC IFTHEN=(WHEN=INIT,OVERLAY=(13:SEQNUM,7,ZD)),                        IFTHEN=(WHEN=GROUP,BEGIN=(19,1,BI,EQ,B'.......1'),                     PUSH=(21:1,12)),                                                IFTHEN=(WHEN=(1,5,CH,EQ,C'DUMMY'),OVERLAY=(1:1,1)),                IFTHEN=(WHEN=(19,1,BI,EQ,B'.......0'),                                 OVERLAY=(34:9,4,ZD,SUB,29,4,ZD,EDIT=(TTTT)),HIT=NEXT),          IFTHEN=(WHEN=(34,4,CH,GT,C'0002'),                                     OVERLAY=(13:X'00'))                                        MERGE FIELDS=(13,7,CH,A),NOEQUALS                                WER276B  SYSDIAG= 24715, 682923, 682923, 1109550                    WER164B  6,904K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED, WER164B     0 BYTES RESERVE REQUESTED, 304K BYTES USED              WER146B  12K BYTES OF EMERGENCY SPACE ALLOCATED                    WER109I  MERGE INPUT  :   TYPE=F; LRECL=    80                      WER257I  INREC RECORD LENGTH =    80                                      WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE=    80              WER410B  5,876K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,  WER410B     0 BYTES RESERVE REQUESTED, 184K BYTES USED                    WER068A  OUT OF SEQ SORTIN02 , BLOCK 5                                    WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Thanks.
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

 Posted: Thu Dec 06, 2012 8:38 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2 What does your data look like?
ramsri

Active User

Joined: 18 Oct 2008
Posts: 380
Location: India

Posted: Thu Dec 06, 2012 9:09 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2

Hi,

I just copy pasted whatever is given here......

 Code: //*                                                                //COUNTCHK EXEC PGM=SORT                                            //SYSOUT   DD SYSOUT=*                                              //SORTOUT  DD DUMMY                                                //SYSIN    DD *                                                      INREC IFTHEN=(WHEN=INIT,OVERLAY=(13:SEQNUM,7,ZD)),                        IFTHEN=(WHEN=GROUP,BEGIN=(19,1,BI,EQ,B'.......1'),                     PUSH=(21:1,12)),                                                IFTHEN=(WHEN=(1,5,CH,EQ,C'DUMMY'),OVERLAY=(1:1,1)),                IFTHEN=(WHEN=(19,1,BI,EQ,B'.......0'),                                 OVERLAY=(34:9,4,ZD,SUB,29,4,ZD,EDIT=(TTTT)),HIT=NEXT),          IFTHEN=(WHEN=(34,4,CH,GT,C'0002'),                                     OVERLAY=(13:X'00'))                                        MERGE FIELDS=(13,7,CH,A),NOEQUALS                                //SORTIN01 DD *                                                    DUMMY                                                              RECORD1 2010                                                        RECORD2 3458                                                        RECORD3 1974                                                        RECORD4 0001                                                        RECORD1 2010                                                        RECORD2 3458                                                        RECORD3 1974    RECORD4 0001    RECORD1 2010    RECORD2 3458    RECORD3 1974    RECORD4 0001    RECORD1 2010    RECORD2 3458    RECORD3 1974    RECORD4 0001    //SORTIN02 DD * DUMMY            RECORD1 2012    RECORD2 3457    RECORD3 1973    RECORD4 0005    RECORD1 2012    RECORD2 3457    RECORD3 1973    RECORD4 0005    RECORD1 2012    RECORD2 3457    RECORD3 1973 RECORD4 0005 RECORD1 2012 RECORD2 3457 RECORD3 1973 RECORD4 0005

Thanks.
dick scherrer

Moderator Emeritus

Joined: 23 Nov 2006
Posts: 19254
Location: Inside the Matrix

Posted: Thu Dec 06, 2012 9:48 pm    Post subject:

Hello,

Is there some reason you did not correct this?

 Code: WER068A  OUT OF SEQ SORTIN02 , BLOCK 5

If you do not correct the error info provided, there is not much we can do. . .
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

Posted: Thu Dec 06, 2012 10:00 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2

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 :-)
dick scherrer

Moderator Emeritus

Joined: 23 Nov 2006
Posts: 19254
Location: Inside the Matrix

Posted: Thu Dec 06, 2012 11:10 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2

Hi Bill,

 Quote: Sorry, but Ramsri has deluded everyone into thinking the results are wrong
I believe what is happening is a User Abend (U0016) rather than an RC=whatever as desired.

Until the sequence error is corrected, i suspect no further progress will be made.

d
 All times are GMT + 6 HoursGoto page 1, 2  Next
 Page 1 of 2

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics how to get total count from numeric d... Suehowe SYNCSORT 9 Fri Oct 09, 2020 8:34 pm Creating a single-record file with CO... Joerg.Findeisen DFSORT/ICETOOL 8 Tue Oct 06, 2020 8:19 pm issue with Syntax error shub2204 SYNCSORT 2 Wed Aug 12, 2020 3:11 pm Identify the count from two diffrent ... UmashankarSubramani DFSORT/ICETOOL 19 Sat Jul 11, 2020 4:35 am VSAM Open During Copy-Excessive EXCP ... David Beckham JCL & VSAM 1 Sat Jun 27, 2020 5:23 pm

 © 2003-2020 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us