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: 1232
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 Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


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