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

FIXED DECIMAL to CHAR conversion


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 05, 2008 8:33 pm
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
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

Moderator Emeritus


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

PostPosted: Wed Nov 05, 2008 10:25 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Pulling a fixed number of records fro... DB2 2
No new posts 10 byte RBA conversion DB2 2
Search our Forums:

Back to Top