Add sequence number to records



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

Add sequence number to records

Postby Prasanna G » Mon Jun 15, 2015 6:28 pm

Hi

I have a variable length file of LRECL 27994. The file contains records as follows.

SCUSTOMR...................-..41994021
SCUSTOFL.................../...0000000
SCUSLOCN...................Âç..1994021
SCUSTOMR...................øÌ..201402
SCUSTOFL...................É:..200803
SCUSTOMR...................µ. 200004
SCUSTOFL...................~...000000
SCUSLOCN...................sç 199907
SCUSTAMO...................t. 201403
SCUSTOMR...................µ. 200005
SCUSTOMR...................µ. 200007


Whenever a record starts with SCUSTOMR a new number should be prefixed and the same should be carry forwarded to rest of the records until another record with SCUSTOMR is encountered.

0001SCUSTOMR...................-..4199402
0001SCUSTOFL.................../...0000000
0001SCUSLOCN...................Âç..199402
0002SCUSTOMR...................øÌ..201402
0002SCUSTOFL...................É:..200803
0003SCUSTOMR...................µ. 200004
0003SCUSTOFL...................~...000000
0003SCUSLOCN...................sç 199907
0003SCUSTAMO...................t. 201403
0004SCUSTOMR...................µ. 200005
0005SCUSTOMR...................µ. 200007
.

Kindly help me to achieve the above using SYNCSORT FOR Z/OS 2.1.0.0R.

Thanks
Prasanna G.
User avatar
Prasanna G
 
Posts: 59
Joined: Tue Apr 12, 2011 9:49 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Add sequence number to records

 

Re: Add sequence number to records

Postby BillyBoyo » Mon Jun 15, 2015 6:33 pm

You need to first arrange the space to extend the record, in INREC with WHEN=INIT and BUILD something like (1,4,4X,5).

Then you continue with IFTHEN=(WHEN=GROUP with BEGIN for your significant value, and PUSH=(5:ID=4).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post