Altering the RECORDs in a GROUP
Posted: Wed Oct 12, 2011 5:36 pm
Hi Good Day !!
I'm trying find a way to alter the records in a GROUP. I wanted to bring in the THIRD record in a group as FRIST record, would it be possible to make it that way ? Can someone help. Mentioned below is an example that i'm looking at. RECFM=FB and LRECL=200.
Once the group is identified with the above criteria, i'm want to know to how to push the THIRD record as FIRST one in the GROUP.
Appreciate the response.
Thank You.
Rajesh.
I'm trying find a way to alter the records in a GROUP. I wanted to bring in the THIRD record in a group as FRIST record, would it be possible to make it that way ? Can someone help. Mentioned below is an example that i'm looking at. RECFM=FB and LRECL=200.
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(5,5,CH,EQ,C'ABCDE'),
END=(5,3,CH,EQ,C'IEA'),
PUSH=(205:ID=5,SEQ=5))
SORT FIELDS=COPY
BEGIN=(5,5,CH,EQ,C'ABCDE'),
END=(5,3,CH,EQ,C'IEA'),
PUSH=(205:ID=5,SEQ=5))
SORT FIELDS=COPY
Once the group is identified with the above criteria, i'm want to know to how to push the THIRD record as FIRST one in the GROUP.
INPUT
ISA*ABCDE*00**00**00*
GK*PR*KROGER*1*006990
GS*PR*123456789121212
N3*7171 GOODLETT FAR
N4*CORDOVA*TN*380160*
IEA*77368*20110930~
OUTPUT
GS*PR*123456789121212
ISA*ABCDE*00**00**00*
GK*PR*KROGER*1*006990
N3*7171 GOODLETT FAR
N4*CORDOVA*TN*380160*
IEA*77368*20110930~
ISA*ABCDE*00**00**00*
GK*PR*KROGER*1*006990
GS*PR*123456789121212
N3*7171 GOODLETT FAR
N4*CORDOVA*TN*380160*
IEA*77368*20110930~
OUTPUT
GS*PR*123456789121212
ISA*ABCDE*00**00**00*
GK*PR*KROGER*1*006990
N3*7171 GOODLETT FAR
N4*CORDOVA*TN*380160*
IEA*77368*20110930~
Appreciate the response.
Thank You.
Rajesh.