Archive for the ‘Fujitsu Cobol’ Category

Converting Native Fujitsu Cobol Numeric Fields to / from Decimal

Monday, June 13th, 2011

There are any number of bizarre syntax rules concerning the interaction of native Cobol data types and .Net data types.  One of the stranger ones is this:  If you want to convert a .Net Decimal value to a native Cobol numeric field, that field must be signed.  Oddly enough, the inverse is not true.  You can convert unsigned Cobol fields to .Net Decimal values.  So, to convert Decimal to Cobol you must do something like this:

01  WS-TEMP PIC S9(5)V99.
01  WS-VALUE PIC 9(5)V99.
01  WS-DECIMAL OBJECT REFERENCE CLASS-DECIMAL.

SET WS-TEMP TO WS-DECIMAL.
MOVE WS-TEMP TO WS-VALUE.

What at PITA!

Global Compiler Options for Fujitsu Cobol

Monday, June 13th, 2011

There are certain compiler options that must be applied to Fujitsu Cobol projects that must be the same for all projects if things are to work properly.  For example, there is an option that controls the internal representation of signed USAGE DISPLAY numbers.  If different programs use different options then they are going to misinterpret each other’s numeric fields. Fortunately, it is possible to specify options to the Cobol compiler that will be used by all projects.

There is a file named cobol.rsp in the Net Cobol for .Net installation directory that holds the global compiler options.  Simply add a new line to this file for each compiler option that you wish to specify.  For example, to specify 88 Consortium signed numeric field handling, add a line with /wc:”Decimal(88)” to cobol.rsp.

Using RM/Cobol Indexed Files with Fujitsu Cobol

Friday, June 3rd, 2011

We are migrating an application from RM/Cobol to Fujitsu Net Cobol for .Net.  As part of this, we want to be able to access indexed files from RM and Fujitsu programs concurrently.  Since the Fujitsu indexed file handler appears to have been licensed from RM back in the misty depths of time, this would appear to be a no-brainer.  Unfortunately, this turns to not be the case.  While RM files are compatible with Fujitsu programs, there are restrictions.  Here is what I have been able to find out so far: (more…)