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
 

 

How to convert COMP & COMP-3 to decimal format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to convert COMP & COMP-3 to decimal format
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    Post subject:
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: 1224
Location: Israel

PostPosted: Wed Jul 08, 2009 2:44 pm    Post subject:
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jul 08, 2009 7:38 pm    Post subject:
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    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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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