Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

what cobol datatype represents ieee standard ?

Hi,

I wonder which cobol datatype similar to comp-2 can be used to represent the ieee standard.

The task is to call a c programm that uses this standard and build an interface to it on an mvs machine running on zos.

Thanks
Chris
0
chkorte
Asked:
chkorte
1 Solution
 
JesterTooCommented:
Well, I've written a couple million lines of COBOL in my time but it's been about 15 years ;-).  IBM mainframe COBOL compilers (from IBM) don't support the IEEE standard for floating-point representation of numbers... they have their own proprietary format because it matches their hardware design better (more efficient).  I believe their is a proposal to include the standard in the next ANSI COBOL standard.  But, that doesn't necessarily mean IBM will adopt it in their compiler any time soon, though.

If all your code/data resides on MVS you should be able to convert the format of the data being passed as parameters by using a middle-man function written either in C or ALC (or perhaps even in FORTRAN... it may have native support for IEEE now).  If you need to pass the data between platforms you will need to write a translation function on one platform or the other.

The actual implementation of most of the "comp" datatypes is vendor and platform specific.

Here are some links providing more information about the issue with some advice for dealing with it.

   http://www.discinterchange.com/TechTalk_COBOL_comp_.html
   http://www.tek-tips.com/faqs.cfm?fid=5154
   http://www.codecomments.com/Cobol/message387915.html
   http://www.codecomments.com/archive266-2004-5-192923.html

Even more web references can be found by googling for:   cobol ieee binary

HTH,
Lynn
0
 
COBOLdinosaurCommented:
depending on the number of significant digits you probaly want to convert to a numeric represntation as a string in C then bring it into a pic x(?) field where you can dow what ever is necessry to get the right number value.

Or if it is small enough convert to long and and bring it into COBOL as COMP-3.

Cd&
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now