View previous topic :: View next topic |
Author |
Message |
nbdtrjk_1 Beginner
Joined: 14 Jun 2021 Posts: 11 Topics: 4
|
Posted: Tue Jun 15, 2021 3:04 am Post subject: Suppress trailing zeros via SORT |
|
|
All,
I did search before posting my requirement but not finding any results Even I tried via EDIT=(IIIIIIT) type but it did only removed leading zeros
I have requirement to suppress decimal trailing zeros via sort. Could someone assist me on this
Code: | I/P (FB)
12.00
1235.909
1788.190
555.10
O/p(after suppressing trailing zeros)
12.0
1235.909
1788.19
555.1 |
Thanks |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Tue Jun 15, 2021 10:28 am Post subject: |
|
|
nbdtrjk_1,
what is the format of the data ? Is it ZD or PD or plain display data like that you have shown?
If the data is as is as you have shown is the decimal at a constant place? _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
nbdtrjk_1 Beginner
Joined: 14 Jun 2021 Posts: 11 Topics: 4
|
Posted: Tue Jun 15, 2021 8:55 pm Post subject: |
|
|
Hi Kolusu,
It will the plain display data what I have shown in above post and constant place(say starts at 1st post and 8 bytes length)
Thanks |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Wed Jun 16, 2021 6:15 pm Post subject: |
|
|
nbdtrjk_1,
Try this
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5--
12.00
1235.909
1788.190
555.10
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(7,2,UFF,EQ,0),OVERLAY=(7:2X)),
IFTHEN=(WHEN=(8,1,UFF,EQ,0),OVERLAY=(8:1X))
/* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
nbdtrjk_1 Beginner
Joined: 14 Jun 2021 Posts: 11 Topics: 4
|
Posted: Wed Jun 16, 2021 9:02 pm Post subject: |
|
|
Thanks Kolusu. Given code working fine |
|
Back to top |
|
|
|
|