Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hello,
Here's a Syncsort job which does the same. It involves 2 steps,
Step-1: Takes the count from counter file-1, increment by one, save it back to the counter file, also creates a Symbol - CNT for the new count.
Step-2: Overlays the symbol - CNT into the header record.
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= Count file ----------------- FB,LRECL=6
//SORTOUT DD DSN= Count file ----------------- FB,LRECL=6
//C1 DD DSN=&&C1,DISP=(,PASS),UNIT=SYSDA
//SYSIN DD *
INREC BUILD=(1,6,ZD,ADD,+1,TO=ZDF,LENGTH=6)
SORT FIELDS=COPY
OUTFIL FNAMES=C1,BUILD=(C'CNT,C''',1,6,C'''',80:X)
//*
//STEP2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&C1,DISP=(OLD,PASS)
//SORTIN DD DSN= Input file ----------------- FB,LRECL=30
//SORTOUT DD DSN= Output file ----------------- FB,LRECL=30
//SYSIN DD *
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'BOF'),OVERLAY=(11:CNT))
SORT FIELDS=COPY |
|
|