Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 7228

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: 7228

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: 65
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: 7228

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 Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
No new posts Converting EBCDIC to Unicode (TimeStamp) muralikrishnan_new COBOL Programming 2 Mon Jul 25, 2016 10:42 pm
No new posts Convert Decimal to hexadecimal Steve Ironmonger DFSORT/ICETOOL 5 Fri May 27, 2016 4:19 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us