Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Convert Numeric to Packed decimal and add trailing zeros

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Convert Numeric to Packed decimal and add trailing zeros
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

Senior Member


Joined: 21 Sep 2010
Posts: 2352
Location: NY,USA

PostPosted: Thu Aug 08, 2019 4:17 am    Post subject:
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.

https://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: 796
Location: The Universe

PostPosted: Thu Aug 08, 2019 7:13 am    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2352
Location: NY,USA

PostPosted: Thu Aug 08, 2019 7:17 am    Post subject:
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: 2319
Location: Hampshire, UK

PostPosted: Thu Aug 08, 2019 2:11 pm    Post subject: Reply to: Convert Numeric to Packed decimal and add trailing zeros
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

Active Member


Joined: 29 Apr 2008
Posts: 716
Location: Maryland

PostPosted: Thu Aug 08, 2019 8:06 pm    Post subject: Re: Convert Numeric to Packed decimal and add trailing zeros
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. DFSORT-How to convert ZD to ZS in DFSORT useit DFSORT/ICETOOL 2 Thu Mar 26, 2020 10:43 am
No new posts Convert a packed decimal value to zon... Dinesh Mani DB2 6 Mon Mar 16, 2020 6:02 pm
No new posts convert SUPERC compare report to side... jzhardy CLIST & REXX 5 Fri Feb 21, 2020 8:55 am
No new posts How to compare Packed date in details... Floramq SYNCSORT 5 Sun Jan 05, 2020 7:40 am
No new posts Identifying Packed Decimal data in a ... sojivarkey TSO/ISPF 4 Sat Dec 07, 2019 5:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us