IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Convert Numeric to Packed decimal and add trailing zeros


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anand1204

New User


Joined: 16 Jan 2015
Posts: 12
Location: USA

PostPosted: Thu Aug 08, 2019 3:53 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu Aug 08, 2019 4:17 am
Reply with quote

1.This should belong to either DFSORT OR SYNCSORT based on what product you have at site.
2. Please use code tags
3. Search this forum and you will find numerous examples.

www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.iceg200/enf.htm
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Aug 08, 2019 7:13 am
Reply with quote

There is another issue. There are no decimal points in packed decimal data. In other words, your request cannot be done.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu Aug 08, 2019 7:17 am
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Thu Aug 08, 2019 2:11 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2126
Location: USA

PostPosted: Thu Aug 08, 2019 8:06 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts CONVERT a given date from UTC TO BST CICS 0
No new posts small int to zoned decimal conversion DFSORT/ICETOOL 3
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top