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

Data type conversion


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vero123

New User


Joined: 10 Sep 2005
Posts: 4

PostPosted: Sat Sep 10, 2005 9:51 pm
Reply with quote

Hi,

I'd like to know how to convert 9-digit packed decimal data into 16-digit
character data in E-COBOL.

I'd appreciate your reply in this regard.

Thanks
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Sep 10, 2005 10:16 pm
Reply with quote

I guess you know that a 9 DIGIT comp-3 (packed) variable is 5 BYTES long and a 16 DIGIT char variable is 16 BYTES long.

Given that:
Code:

pd-9-digit        pic S9(009) comp-3.
ch-16-digit       pic S9(016).


move pd-9-digit to ch-16-digit


There may be variations on this depending on what you're trying to accomplish.
Back to top
View user's profile Send private message
vero123

New User


Joined: 10 Sep 2005
Posts: 4

PostPosted: Sun Sep 11, 2005 1:23 am
Reply with quote

Thanks for your response
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts 10 byte RBA conversion DB2 2
Search our Forums:

Back to Top