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 SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am


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