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

How to convert COMP & COMP-3 to decimal format


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

New User


Joined: 24 Jun 2006
Posts: 50

PostPosted: Wed Jul 08, 2009 12:13 pm
Reply with quote

Hi,

I have a input file wherein every record should contain data in alphanumeric, decimal, binary, floating-point and packed decimal format.
for alphanumeric and decimal format, its easy to read data from input file and write it to output file.
I am really struggling with the data in hexadecimal format in input file record. i have to read data in hexadecimal format and write it to an output file in human readable format.

Can someone assist me to convert data represented in hexadecimal format in an input file, convert it to decimal format thru some cobol code logic and write the data in output file in decimal format.
Not sure whether cobol support some inbuilt function to take care of it or not. Pls let me know if anyone is aware of such an inbuilt cobol function.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Jul 08, 2009 12:37 pm
Reply with quote

Hi Rahul,

A simple MOVE statement would suffice.. ( Please go thru the COBOL manuals... )

*Note : And i am not sure whether the COMP and COMP-3 formats could be referred to as "hexadecimal" formats...
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jul 08, 2009 2:44 pm
Reply with quote

Check this topic: Convert certain fields of a file from characters to hexa
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 Jul 08, 2009 7:38 pm
Reply with quote

Hello,

Suggest you post the cobol file definition, some of the data (in hex) that matches that definition, and the output you want from this sample data.
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 Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
Search our Forums:

Back to Top