View previous topic :: View next topic |
Author |
Message |
erasani Beginner
Joined: 02 Oct 2021 Posts: 17 Topics: 7
|
Posted: Wed Nov 10, 2021 8:28 am Post subject: Format Numeric fields with leading zeros |
|
|
Hi All,
I am trying to create a file using DFSORT which will be input to a COBOL Program. There are some numeric fields with leading spaces, which need to be formatted as S9(10)V99. I tried converting as TO=ZD, but it does not work as expected. I have shown the input and the desired output below.
Please help me with this.
Input:
Desired Output:
Thanks
Prashanth |
|
Back to top |
|
|
erasani Beginner
Joined: 02 Oct 2021 Posts: 17 Topics: 7
|
Posted: Wed Nov 10, 2021 8:46 am Post subject: |
|
|
I have tried with the below SORT card. Got the output as 000000000001. However, i need the Output as 00000000000A.
Code: | SORT FIELDS=COPY
OUTREC FIELDS=(63,12,SFF,TO=ZD) |
Input
Output
Desired Output
|
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
|
Posted: Wed Nov 10, 2021 3:13 pm Post subject: |
|
|
erasani,
use TO=ZDC which will give you the desired results.
Code: |
OUTREC FIELDS=(63,12,SFF,TO=ZDC) |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
erasani Beginner
Joined: 02 Oct 2021 Posts: 17 Topics: 7
|
Posted: Thu Nov 11, 2021 6:03 am Post subject: |
|
|
Thanks Kolusu for your help. Works perfectly |
|
Back to top |
|
|
|
|