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
 
Proper Decimal alignment when converting from CH to PD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Proper Decimal alignment when converting from CH to PD
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Wed Jun 04, 2014 8:07 pm    Post subject: Reply to: Proper Decimal alignment when converting from CH t
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Thu Jun 05, 2014 12:17 pm    Post subject: Reply to: Proper Decimal alignment when converting from CH t
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    Post subject: Proper Decimal alignment when converting from CH to PD
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    Post subject: Reply to: Proper Decimal alignment when converting from CH t
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Thu Jun 05, 2014 5:20 pm    Post subject: Reply to: Proper Decimal alignment when converting from CH t
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    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 Identifying Packed Decimal data in a ... sojivarkey TSO/ISPF 4 Sat Dec 07, 2019 5:36 am
No new posts Reading the CSV data in COBOL and mov... wik123 COBOL Programming 4 Tue Dec 03, 2019 5:13 pm
No new posts Converting spaces to zeroes A_programmers DFSORT/ICETOOL 7 Tue Oct 01, 2019 12:41 am
No new posts Convert Numeric to Packed decimal and... anand1204 DFSORT/ICETOOL 5 Thu Aug 08, 2019 3:53 am
No new posts Converting a copybook value into Json... srikant314 COBOL Programming 1 Mon Jun 03, 2019 11:17 am

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