Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

issue RC=8 or RC=16 if count diff > 2
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: issue RC=8 or RC=16 if count diff > 2
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 23, 2012 7:56 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Sun Nov 25, 2012 2:31 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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: 1703
Location: Australia

PostPosted: Mon Nov 26, 2012 2:57 am    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Nov 28, 2012 4:23 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Nov 28, 2012 5:03 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Nov 28, 2012 5:13 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 30, 2012 2:50 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Dec 06, 2012 8:38 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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

Site Director


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

PostPosted: Thu Dec 06, 2012 9:48 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Dec 06, 2012 10:00 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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

Site Director


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

PostPosted: Thu Dec 06, 2012 11:10 pm    Post subject: Reply to: issue RC=8 or RC=16 if count diff > 2
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFHRESPONSE returns issue divated CICS 3 Wed Nov 02, 2016 6:32 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Update the Sortout file with record c... karthik_sripal SYNCSORT 8 Tue May 17, 2016 8:52 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us