I have a input with comma delimited records
Each field will be of different variables length
Example
5467,2,567.82
243,10,856
Now I want output to be written as below first field length in the output should be 10 second field length should be 15 and third field length should be 15 with leading zeroes
Order 0000005467 count 000000000000002 amount 000000000567.82
Order 0000000243 count 000000000000010 amount 000000000000856
i have tried below jcl but the amount field is not populated to right justified its populating to left justified as 567820000000.00
//STEP1 EXEC PGM=SYNCSORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input,DISP=SHR
//SORTOUT DD DSN=output1,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE)
//SYSIN DD *
OPTION COPY
INREC PARSE=(%00=(ENDBEFR=C',',FIXLEN=10),
%01=(ENDBEFR=C',',FIXLEN=15),
%02=(FIXLEN=15)),
BUILD=(%00,%01,%02)
OUTREC BUILD=(1,10,UFF,M11,LENGTH=10,
11,15,UFF,M11,LENGTH=15,
26,10,ZD,EDIT=(TTTTTTTT.TT))
/*
//STEP2 EXEC PGM=SYNCSORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=output1,DISP=SHR
//SORTOUT DD DSN=outputfinal,
// DISP=(NEW,CATLG,DELETE),
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TSO.TESTFIS.CDS.CNTRL.RPTS.TT61824,DISP=SH
//SORTOUT DD DSN=TSO.TESTFIS.CDS.CNTRL.RPTS.TT61824.FINALB,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE)
//SYSIN DD *
OPTION COPY
INREC PARSE=(%00=(FIXLEN=10),
%01=(FIXLEN=15),
%02=(FIXLEN=15)),
BUILD=(C'ORDER # ',
%00,
C' COUNT = ',
%01,
C' AMOUNT = ',
%02)
/*
output should be
Order 0000005467 count 000000000000002 amount 000000000567.82
Order 0000000243 count 000000000000010 amount 000000000000856
K Sahiti is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.