Input file: VB - lrecl - 255
The sample input data :
ID_ID,ID_SIZE,LENGTH.100000000,200,5.100000001,300,6.100000002,100,3.100000
003,10000,5.100000004,10000,1.100000005,10000,5.
003,10000,5.100000004,10000,1.100000005,10000,5.
Output file: FB - 95
The below is expected output.
ID_ID ID_SIZE LENGTH
100000000 200 5
100000001 300 6
100000002 100 3
100000003 10000 5
100000004 10000 1
100000005 10000 5
100000000 200 5
100000001 300 6
100000002 100 3
100000003 10000 5
100000004 10000 1
100000005 10000 5
Code:
INREC IFTHEN=(WHEN=INIT,
PARSE=(%0=(ENDBEFR=X'05',FIXLEN=20), * ID_ID,ID_SIZE,LENGTH
%1=(ENDBEFR=X'05',FIXLEN=15)), * 100000000,200,5.100000001
BUILD=(1,4,
%0,
%1,
80:X)),
IFTHEN=(WHEN=INIT,
FINDREP=(IN=C',',OUT=C' ',
STARTPOS=5,ENDPOS=95)),
OPTION COPY
*
OUTREC BUILD=(1:1,4,
5:5,75,
95:X)
*
OUTFIL BUILD=(5,36,/,42,15,95:X),VTOF
END
PARSE=(%0=(ENDBEFR=X'05',FIXLEN=20), * ID_ID,ID_SIZE,LENGTH
%1=(ENDBEFR=X'05',FIXLEN=15)), * 100000000,200,5.100000001
BUILD=(1,4,
%0,
%1,
80:X)),
IFTHEN=(WHEN=INIT,
FINDREP=(IN=C',',OUT=C' ',
STARTPOS=5,ENDPOS=95)),
OPTION COPY
*
OUTREC BUILD=(1:1,4,
5:5,75,
95:X)
*
OUTFIL BUILD=(5,36,/,42,15,95:X),VTOF
END
ID_ID ID_SIZE LENTH
100000000 100 8
003 10000 5.100000004 10000 1.100000005
100000000 100 8
003 10000 5.100000004 10000 1.100000005
Please suggest.