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

Conversion of EBCDIC representation to Decimal problem


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top