Microsoft KB Archive/67889

Common Questions When Converting from COBOL 3.0 to 4.0

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

4.00 MS-DOS

Summary: The following are possible reasons why a successful COBOL version 3.0 program might fail to compile, link, or run in Microsoft COBOL Professional Development System (PDS) version 4.0: 1. The wrong LINKer version executed can cause LINK errors. 2. Errors can occur if ADIS executables are not in shared run-time system support modules. 3. Command-line differences between 4.0 and 3.0 can cause errors during compile or LINK. 4. Programmer’s WorkBench (PWB, introduced in COBOL 4.0) requires particular options. 5. CALL X“91” function 35 batch commands are not supported in COBOL 4.0. 6. ISAM file handling differs between COBOL 4.0 and 3.0.

More Information: 1. LINKer version – LINK.EXE version 5.11 ships with COBOL 4.0. The setup procedure adds the COBOL directories to the end of the current DOS PATH statement. A different copy of LINK.EXE encountered earlier in the PATH, such as LINK.EXE in the DOS directory, can produce a variety of linking errors. You must use the LINK.EXE version shipped with the product (or a later LINK.EXE version number). 2. Shared run-time system – In COBOL 4.0, you must create dynamically linked executable files for ADIS, EXTFH, EXTERNL, and CMS. The LINK command-line syntax for run-time system support appears on page 5-9 of “Microsoft COBOL 4.0: Operating Guide.” 3. Command-line differences for compile and/or LINK – If you invoke the compiler or linker from batch or command files rather than from the DOS prompt, examine all statements in the batch files. Some of the syntax may not be necessary for COBOL 4.0. The LINK command line may have to be changed to specify the desired run-time system. For more information on LINKing, see chapter 5 of “Microsoft COBOL 4.0: Operating Guide.” 4. Using PWB – Microsoft Programmer’s WorkBench version 1.1 has many options that must be explicitly set before PWB will properly invoke the COBOL 4.0 compiler and LINK version 5.11. For more information on this subject, query on the following words: COBOL and 4.00 and PWB and build options 5. X“91” with function 35 batch file execution – In COBOL 3.0 and 3.0a, function 35 of the special subprogram X“91” can be used to execute batch files. The third parameter passed specifies the batch file to be executed. This technique does not work with a program compiled and linked with COBOL 4.0. To run batch files from a COBOL 4.0 program, the DISPLAY UPON COMMAND-LINE statement must be used to place the name of the batch file into the command line. For more information on this subject, query on the following words: COBOL and 4.00 and 3.00 and batch files 6. ISAM files – In COBOL 4.0, IXSIO ISAM file handling modules are included in EXTFH files used for indexed and external file handling. This may require changes in the LINK command-line syntax.

Additional reference words: 4.00 Copyright Microsoft Corporation 1993.