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

Proper Decimal alignment when converting from CH to PD


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

New User


Joined: 29 Jun 2006
Posts: 25

PostPosted: Wed Jun 04, 2014 7:54 pm
Reply with quote

Hi all.

I have a requirement to convert the CH to PD.

-1234
-1234.2
-1234.25

OUTREC FIELDS=(1,14,SFF,TO=PD.LENGTH=7)

But i got the below output.

-12.34
-123.42
-1234.25

suggest me how can i convert the data from char to PD without disturbing the decimal positions

Thanks.
Sudhakar.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jun 04, 2014 8:07 pm
Reply with quote

Please use the Code Tags to preserve spacing. Please paste from your emulator to avoid typos. Please try to search the forum before asking, as this issue has been addressed in the past.
Back to top
View user's profile Send private message
sudhakar_mainframe
Warnings : 1

New User


Joined: 29 Jun 2006
Posts: 25

PostPosted: Thu Jun 05, 2014 11:16 am
Reply with quote

Not able to get the links. Please give some of them. Explain me with some examples

Thanks,
Venkata.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jun 05, 2014 12:17 pm
Reply with quote

Try this one.
Back to top
View user's profile Send private message
sudhakar_mainframe
Warnings : 1

New User


Joined: 29 Jun 2006
Posts: 25

PostPosted: Thu Jun 05, 2014 1:39 pm
Reply with quote

This link is not much useful.

The I/p data looks like below

----+----|
-1234 
-1234.2 
-1234.25


The output should looks like below
----+----|
-1234.00
-1234.20
-1234.25

Thanks,
Sudhakar.
Thanks
Back to top
View user's profile Send private message
Abid Hasan

New User


Joined: 25 Mar 2013
Posts: 88
Location: India

PostPosted: Thu Jun 05, 2014 1:55 pm
Reply with quote

Hello,

The link Bill has shared gives you more than enough information to go on; did you look up the DFSORT manual on the usage of PARSE?
You should be able to build the SORT card using that information, instead of having someone spoon-feed the solution for you.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jun 05, 2014 5:20 pm
Reply with quote

In your sample data, you show a fixed start, and a fixed position for the decimal point.

If that accurately and fully represents your data, then you won't need PARSE. Just IFTEHN=(WHEN=(logical expression) for, first C' ' in the last three bytes, with OVERLAY for C'.00', then for C' ' in the last byte, and change to C'0'.

However, with a variable start, or a variable number of integer digits, you will have to use PARSE. Your existing use of SFF implies a "free format" (non-fixed) field. but there is no necessity that that was a good choice.
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 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 Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
Search our Forums:

Back to Top