IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

issue RC=8 or RC=16 if count diff > 2


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Nov 23, 2012 7:44 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Fri Nov 23, 2012 7:56 pm
Reply with quote

SyncSort manual handy?

Have a look at OUTFIL and see if NULLOFL exists, or some other processing for no records on an OUTFIL group.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sat Nov 24, 2012 9:41 pm
Reply with quote

Ok....will give a try.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sun Nov 25, 2012 9:08 am
Reply with quote

Hi,

I tried below two step SORT solution (could not combine INREC with JOINKEYS) but to no avail icon_sad.gif It still ends with MAXCC=0000. icon_eek.gif 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                   


Please suggest. Thanks.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Sun Nov 25, 2012 2:19 pm
Reply with quote

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?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Sun Nov 25, 2012 2:31 pm
Reply with quote

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)?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Nov 26, 2012 2:57 am
Reply with quote

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
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Tue Nov 27, 2012 4:14 pm
Reply with quote

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.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Nov 28, 2012 3:57 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Wed Nov 28, 2012 4:23 pm
Reply with quote

Ramsri,

There were other questions.

What output are you expecting? Just the RC, or some indication of what didn't "get close" to matching?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Wed Nov 28, 2012 5:03 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Wed Nov 28, 2012 5:13 pm
Reply with quote

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
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Nov 29, 2012 9:39 am
Reply with quote

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.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Fri Nov 30, 2012 2:50 pm
Reply with quote

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 :-)
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Dec 06, 2012 8:25 pm
Reply with quote

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                             


Please suggest.

Thanks.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Thu Dec 06, 2012 8:38 pm
Reply with quote

What does your data look like?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Dec 06, 2012 9:09 pm
Reply with quote

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.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Dec 06, 2012 9:48 pm
Reply with quote

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. . .
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Thu Dec 06, 2012 10:00 pm
Reply with quote

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 :-)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Dec 06, 2012 11:10 pm
Reply with quote

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
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Fri Dec 07, 2012 12:09 am
Reply with quote

Ah. Well, DFSORT has an ABEND/NOABEND option. Has SyncSort?

With NOABEND, you get the RC=16, for DFSORT.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Dec 07, 2012 12:43 am
Reply with quote

Hello,

The latest Syncsort documentation does not contain NOABEND.

Wonder if the problem has been corrected and the job successfully run?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Dec 07, 2012 4:48 pm
Reply with quote

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

Thanks a lot for your time and help.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Fri Dec 07, 2012 5:05 pm
Reply with quote

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).
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Dec 07, 2012 8:28 pm
Reply with quote

@ramsri,

You simply MUST stop using really bad terminology.

Syncsort DOES NOT EVER set MAXCC. Ever.

As you continue to use bad terminology all you do is cause lost time when people try to help you.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
Search our Forums:

Back to Top