Microsoft KB Archive/32485

Passing Floating-Point Values to Non-COBOL Routines; Example

PSS ID Number: Q32485 Article last modified on 04-21-1993

3.00 3.00a 4.00 | 3.00 3.00a 4.00 MS-DOS | OS/2

Summary: The following is an example of passing floating-point values from a COBOL Version 3.0 or 3.0a program to a C, FORTRAN, or Pascal routine called with the CALL statement: WORKING-STORAGE SECTION. 01 A-NUMBER. 05 FRED PIC 99V99. 05 PASS REDEFINES FRED. 10 WHOLE-PART PIC 99. 10 FRACTIONAL-PART PIC 99. 01 PASS-NUMBER. 05 P-WHOLE-PART PIC 99 COMP-5. 05 P-FRACTIONAL-PART PIC 99 COMP-5. PROCEDURE DIVISION. MOVE WHOLE-PART TO P-WHOLE-PART. MOVE FRACTIONAL-PART TO P-FRACTIONAL-PART. CALL “C_SUB1” USING P-WHOLE-PART, P-FRACTIONAL-PART. Microsoft COBOL Versions 3.0 and 3.0a can be linked with the following product versions: Microsoft FORTRAN Versions 4.0, 4.01, and 4.1 Microsoft Pascal Version 4.0 Microsoft C Versions 5.0 and 5.1

Additional reference words: 3.00 3.00a 4.00 Copyright Microsoft Corporation 1993.