Adding SEQNUM



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

Adding SEQNUM

Postby Joe Mangell » Mon Feb 15, 2010 8:48 pm

Hi,

Using your excellent forum I have managed to successfully use the JOINKEYS function to give me unmatched records from 2 variable length files.

However the original files have the following format:
00 Header record
D: Lots of delimited data
99 Footer Record

So when I run the JOINKEYS code it also sorts the data (by record length) and gives me:
99 Footer Record
00 Header Record
D: my unmtached data.

The rest of my processing requires the records to be in the original order.
I used SORT FIELDS=COPY. I note from one of your other replies that it's possible to add a SEQNUM so I could sort it again afterwards.

I've been trying all morning and getting lots of errors such as WER244A OUTREC - SHORT RECORD.

We generally use files that are VB 27994 - this is the latest in a long line of attempts:

//SAVL01S JOB 1,NTC,MSGLEVEL=(1,1),MSGCLASS=X,TIME=1440
//*MAIN CLASS=LONG
//SORT1 EXEC PGM=SYNCSORT,REGION=150M,COND=(0,NE)
//SORTIN DD DSN=SBCL.£SAVLQ0.ML2RAW.D2100206.NTSS.F002.N000,
// DISP=SHR
//SORTOUT DD DSN=SAVL01.NTCTEST.SORTDUPA.OUT,
// DCB=(RECFM=VB,LRECL=27994,DSORG=PS),
// UNIT=SYSDA,VOL=(,,,40),MGMTCLAS=ML2BACK1,
// SPACE=(TRK,(30000,4000),RLSE),
// DISP=(NEW,CATLG)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY,STOPAFT=10
OUTREC FIELDS=(1,27986,SEQNUM,8,ZD)
//

Any help appreciated.
Thanks,
Mike.
Joe Mangell
 
Posts: 2
Joined: Mon Feb 15, 2010 8:19 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time

Re: Adding SEQNUM

Postby Alissa Margulies » Mon Feb 15, 2010 9:26 pm

Since it is VB data, try this instead:
//SYSIN DD *
  SORT FIELDS=COPY,STOPAFT=10
  OUTREC FIELDS=(1,4,5:SEQNUM,8,ZD,13:5)
 

You will need to shift the starting positions of all of your control statements (after position 4) by 8 bytes in any successive steps to accommodate for the inserted SEQNUM.

Also, in the JOIN step that follows, instead of performing a COPY you can then SORT on the SEQNUM and then use OUTREC to strip it out. For example:
//SYSIN DD *
  JOINKEYS...
  JOINKEYS...
  JOIN UNPAIRED,F2,ONLY
  REFORMAT...
  SORT FIELDS=(5,8,ZD,A)
  OUTREC FIELDS=(1,4,13)
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: Adding SEQNUM

Postby Joe Mangell » Mon Feb 15, 2010 10:00 pm

Hi Alissa,

Thank you so much!!
You're a legend.

Thanks,

Mike.
Joe Mangell
 
Posts: 2
Joined: Mon Feb 15, 2010 8:19 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post