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
 

 

Conversion of EBCDIC representation to Decimal problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Itallian_Stallion_4u

New User


Joined: 17 Oct 2005
Posts: 10

PostPosted: Fri Jan 06, 2006 12:17 pm    Post subject: Conversion of EBCDIC representation to Decimal problem
Reply with quote

Hi,
My requirement is i have an input file on which at column 22 & 23 i have a character data , but when writing into the output file it should be written in its equivalent decimal format.

For eg,

If value = 'PA' then the EBCDIC representation of the two characters PA is $D7 and $C1 (in hexadecimal representation)$D7C1 converted to decimal is 55233 which is the value that will be written in output file in place of PA.
Can anyone tell me how to go about it ???
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Sat Jan 07, 2006 4:40 am    Post subject: Re: Conversion
Reply with quote

From your description, this doesn?t sound like character data. What I believe you have is binary data stored in a PIC X(2) field. Redefine the two bytes as PIC 9(4) COMP. You can then move the redefined field to wherever you want.

You can store 0 - 65535 in a PIC 9(4) COMP field and
-32767 to +32767 in a PIC S9(4) COMP field.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am


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