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: 2213
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: 746
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: 2213
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: 2202
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: 512
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
No new posts Training on numeric fields data formats sergeyken SYNCSORT 11 Thu Aug 01, 2019 8:15 pm
No new posts Alphanumeric to Packed Decimal Conver... Vijay_Sirisha COBOL Programming 2 Mon May 27, 2019 2:52 am
No new posts Compare fields with decimal chandan.inst SYNCSORT 6 Thu Apr 04, 2019 5:29 pm
No new posts Comparison of numeric edited variables Nileshkul COBOL Programming 4 Sat Mar 16, 2019 1:18 am
No new posts Convert alpha numeric to signed digits Balu5491 COBOL Programming 4 Mon Feb 25, 2019 10:39 pm

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