Thanks Enrico/Prins,
Here is the code for ref:
//TOOLIN DD *
COPY FROM(INDD) TO(OUT01) USING(CTL1)
COPY FROM(OUT01) TO(OUT02) USING(CTL2)
COPY FROM(OUT02) TO(OUT03) USING(CTL3)
COPY FROM(OUT02) TO(OUT04) USING(CTL4)
SPLICE FROM(OUT04) TO(OUT05) ON(103,4,ZD) WITH(01,90) -
WITH(110,10) KEEPNODUPS
//CTL1CNTL DD *
OUTFIL PARSE=(%01=(ABSPOS=01,FIXLEN=90),
%02=(ABSPOS=91,STARTAT=NONBLANK,FIXLEN=04)),
BUILD=(1:%01,/,1:90X,95:%02,99:42X)
//CTL2CNTL DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(01,90,CH,EQ,C' '),
END=(01,90,CH,NE,C' '),RECORDS=2,
PUSH=(103:ID=4))
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(01,50,CH,NE,C' '),
RECORDS=1,PUSH=(110:ID=4))
//CTL3CNTL DD *
OPTION COPY
INCLUDE COND=(103,4,CH,EQ,C' ')
//CTL4CNTL DD *
OPTION COPY
INCLUDE COND=(103,4,CH,NE,C' ')
/*
concatenation of OUT03 and OUT05 is giving me output as expected after applying OMIT for the last line
here is my input
@1 WXXX-HXXX-DXX-PX-IX 10. 12 12
@7 WXXX-HXXX-PX-IX 10. 12 24
@13 WXXX-BXXX-EXXX-CXX-CX $1. 3 27
@14 WXXX-PXXX-BXXX-IX $8. 10 37
@22 WXXX-BXXX-EXXX-CX $8. 10 47
@30 WXXX-BXX-SXX-DX $10. 12 59
and the output is:
@1 WXXX-HXXX-DXX-PX-IX 10. 12
@7 WXXX-HXXX-PX-IX 10. 12 12
@13 WXXX-BXXX-EXXX-CXX-CX $1. 3 24
@14 WXXX-PXXX-BXXX-IX $8. 10 27
@22 WXXX-BXXX-EXXX-CX $8. 10 37
@30 WXXX-BXX-SXX-DX $10. 12 47
Please suggest me if there is a better way to do this.. bcz this code gives me a feeling like I have coded too much line for this small requirement.