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
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
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.