Microsoft KB Archive/42551

COBOL System Subprograms Can Be CALLed with Level 78, not 77

PSS ID Number: Q42551 Article last modified on 04-20-1993

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

Summary: Microsoft COBOL Versions 3.0 and 3.0a contain many “built-in” subprograms that can be called from within a COBOL program. These subprograms are written in assembly language and can be CALLed either by using a level 78 constant or by actually hard-coding the name of the routine.

More Information: These subprograms can use facilities provided by MS-DOS functions or perform various functions not available by the COBOL programming language. These functions can be CALLed using the two different methods. The syntax for the call is as follows: CALL subprogram-number USING parameter-list The subprogram-number is a single byte that represents the subprogram you want to execute. Each of the CALLs with its subprogram-number is listed in the “Microsoft COBOL Compiler Version 3.0: Operating Guide,” Chapter 8. The parameter-list depends on the particular subprogram and whether there is an input value or a return value. Code Example The two methods of CALLing one of these assembly subprograms is illustrated below. This program uses the default directives. WORKING-STORAGE SECTION. 01 PRODUCT-CODE. 05 what PIC X(18) VALUE “Hard Call to Beep.”. 05 whatcons PIC X(22) VALUE “Constant Call to Beep.”. 78 constant-call VALUE X“E5”. PROCEDURE DIVISION. EXHIBIT what. CALL X“E5”. EXHIBIT whatcons. CALL constant-call. STOP RUN.

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