View previous topic :: View next topic
|
Author |
Message |
anand1204
New User
Joined: 16 Jan 2015 Posts: 12 Location: USA
|
|
|
|
Hi,
I need help in JCL SoRT. I have numeric data in my Input file and i need to convert it to Packed decimal and add trailing zero's at the end.
Here is my I/P :
column 1-4
1200
2345
3542
Expected output :
1200.00
2345.00
3542.00
Thanks |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
There is another issue. There are no decimal points in packed decimal data. In other words, your request cannot be done. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Steve, That’s correct and I guess TS would have said to convert to equivalent of DEC(6,2) or PIC 9(4)V99. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
There is no JCL Sort - there is DFsort and SyncSort and others but no JCL sort. Moving to DFSort. If you are using SyncSort (look at your sort messages) then it can be moved there - once you let us know. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
anand1204 wrote: |
Hi,
I need help in JCL SoRT. I have numeric data in my Input file and i need to convert it to Packed decimal and add trailing zero's at the end.
Here is my I/P :
column 1-4
1200
2345
3542
Expected output :
1200.00
2345.00
3542.00
Thanks |
0) SORT is not JCL, and it has no more relation to JCL than any other existing utility/program/module
1) Your sample output is not packed decimal, it is a simple character string. To implement this example you would need just to concatenate character string C'.00' to previous 4-character string from your data.
2) In all machine-format numeric data with fixed decimal point (e.g. PIC 9...9 COMP-x in COBOL notation), this decimal point is assumed at the same specified position; it is never stored in any manner. (In floating-point formats the position of decimal point is defined via exponent part of its numeric machine format, but this case is definitely off-topic here)
3) You definitely need RTFM - something about computers, data formats, computer programming, data processing methods, algorithms, programming languages, testing and debugging, etc. etc. etc. |
|
Back to top |
|
|
|