Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
FIXED DECIMAL to CHAR conversion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
vimalprabhakaran

New User


Joined: 13 Feb 2006
Posts: 13

PostPosted: Wed Nov 05, 2008 8:26 pm    Post subject: FIXED DECIMAL to CHAR conversion
Reply with quote

I have a field as below
RATE FIXED DEC (13,5);

I need to move this to a CHAR field RATE_CHAR in a file. The field is of type CHAR.

The value in RATE is 123456.12345
In the RATE_CHAR i need to get the value as 0123456.12345

What I have to do for this?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Wed Nov 05, 2008 8:33 pm    Post subject: Reply to: FIXED DECIMAL to CHAR conversion
Reply with quote

look at the manual for the PIC clause
Back to top
View user's profile Send private message
vimalprabhakaran

New User


Joined: 13 Feb 2006
Posts: 13

PostPosted: Wed Nov 05, 2008 10:11 pm    Post subject:
Reply with quote

Could you pls give me a manual with the same?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Nov 05, 2008 10:25 pm    Post subject:
Reply with quote

Hello,

Quote:
Could you pls give me a manual with the same?
At the top of the page there is a link to "IBM Manuals". On that page, are the PL/I Language Reference and Programming Guide which should be what you need.

If you find something in the manual that is not clear, post what you found and your question about it. Someone will be able to clarify.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Thu Nov 06, 2008 12:45 pm    Post subject:
Reply with quote

Hi Vimal,
You can do it in the following way.

DCL RATE FIXED DEC (13,5) INIT(123456.12345);
DCL RATEP PIC '9999999V.99999';
DCL RATEC CHAR(13);
RATEP=RATE;
RATEC=RATEP;
PUT SKIP LIST('RATE RATEP RATEC: ',RATE,RATEP,RATEC);


and the result is
RATE RATEP RATEC: 123456.12345 0123456.12345 0123456.12345
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm

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