Sort Card to Combine two records



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Sort Card to Combine two records

Postby rtammire » Wed Nov 28, 2012 6:17 pm

Hi All,

am facing issue with combining two records by using sort card. Please find below the details
Issue: WER213A ILLEGAL SUM DATA FIELD

//SORTIN DD *
00001STMT07
00001000013
00002STMT08
00002000098
00003STMT35
00003000003
//SORTOUT DD *
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=D
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(101:SEQNUM,1,ZD,RESTART=(1,5))),
IFTHEN=(WHEN=(101,1,ZD,EQ,1),BUILD=(1,5,6,6,6Z)),
IFTHEN=(WHEN=(101,1,ZD,EQ,2),BUILD=(1,5,6Z,12,6))
SORT FIELDS=(1,5,CH,A),EQUALS
SUM FIELDS=(6,6,12,6),FORMAT=BI

Expected Output:

00001STMT07000013
00002STMT08000098
00003STMT35000003

Error Message:

WER146B 32K BYTES OF EMERGENCY SPACE ALLOCATED
WER213A ILLEGAL SUM DATA FIELD
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80

Can anyone please let me know what is the issue. Thank You
rtammire
 
Posts: 12
Joined: Tue Nov 27, 2012 1:19 am
Has thanked: 1 time
Been thanked: 0 time

Re: Sort Card to Combine two records

Postby BillyBoyo » Wed Nov 28, 2012 6:29 pm

Did you look up the message WER213A ILLEGAL SUM DATA FIELD? If you do, it'll tell you that your field has to be 2, 4 or 8 bytes long when SUMming, I suspect.

These users thanked the author BillyBoyo for the post:
rtammire (Wed Nov 28, 2012 7:42 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sort Card to Combine two records

Postby BillyBoyo » Wed Nov 28, 2012 6:51 pm

I've looked at your control cards now: you don't need FORMAT=BI, you need FORMAT=ZD, and you need to put zeros instead of the binary-zeros when you are doing the shuffling about.

It is an interesting way to combine two records, shows a bit of initiative, however, if you have WHEN=GROUP available, you'll find a neater solution which does not require sorting the file (for the SUM to operate). It will require an OUTFIL with OMIT/INCLUDE to get your complete records and discard the incomplete ones.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sort Card to Combine two records

Postby rtammire » Wed Nov 28, 2012 7:51 pm

HI Billy,

Thanks for the help.. As per your response i understood that it will be easy to combine two records with WHEN=GROUP but am not much comfort with this keyword..:(

Can you please provide a sample sort card which is having WHEN=GROUP keyword so that i can modify it as per my requirement. It could be better if you provide sort card for my requirement.. Thank You
rtammire
 
Posts: 12
Joined: Tue Nov 27, 2012 1:19 am
Has thanked: 1 time
Been thanked: 0 time

Re: Sort Card to Combine two records

Postby BillyBoyo » Thu Nov 29, 2012 1:35 am

Have a try with this, then look it all up and explain how it works.

   OPTION COPY
   INREC IFTHEN=(WHEN=INIT,OVERLAY=(25:SEQNUM,1,ZD,RESTART=(1,5))),
         IFTHEN=(WHEN=GROUP,BEGIN=(25,1,CH,EQ,C'1'),
                  RECORDS=2,
                  PUSH=(30:1,11)),
         IFTHEN=(WHEN=(25,1,CH,EQ,C'2'),
                  BUILD=(30,11,6,6,25,1))
         OUTFIL INCLUDE=(18,1,CH,EQ,C'2'),BUILD=(1,17)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sort Card to Combine two records

Postby rtammire » Thu Nov 29, 2012 3:25 pm

Hi Billy..

Thanks for sample sort card...

I have modified as per requirement and its working fine..

Thank you once again
rtammire
 
Posts: 12
Joined: Tue Nov 27, 2012 1:19 am
Has thanked: 1 time
Been thanked: 0 time

Re: Sort Card to Combine two records

Postby BillyBoyo » Thu Nov 29, 2012 3:26 pm

Make sure you understand it, there is not much point in just having it.

Why the post in the other forum, you didn't trust answers here?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post