View previous topic :: View next topic
Author
Message
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
Hi,
I have an input dataset that contains numeric fields in positions 30 and 40. I wans to subtract field 40 from field 30 and put the result in column 50. The field 30 may contain zeros.
Input:
Code:
----+----1----+----2----+----3----+----4----+----5
00204 00100
01444 00505
00793 00128
01640 00980
10106 09105
Below is the code I used and would like to know why subtracted value appears at 62nd column instead of 50th column !!!
Code:
//JOB00001 EXEC PGM=SORT
//SORTIN DD *
00204 00100
01444 00505
00793 00128
01640 00980
10106 09105
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(50:30,5,ZD,SUB,40,5,ZD,80:X)
Thanks.
Back to top
ramsri Active User Joined: 18 Oct 2008Posts: 380 Location: India
Ok folks........I got it right now.
Code:
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(50:30,5,ZD,SUB,40,5,ZD,M11,LENGTH=5,80:X)
I had to add the M11 & LENGTH=N to achieve it.
Thanks.
Back to top
Please enable JavaScript!