Microsoft KB Archive/49131

COBOL 3.00/3.00a Hangs When Opening More Than 5 EXTERNAL Files

PSS ID Number: Q49131 Article last modified on 11-18-1990

3.00 3.00a MS-DOS

Summary: In Microsoft COBOL version 3.00 or 3.00a, attempting to open more than five EXTERNAL files can hang the machine, requiring a cold reboot. This can happen with files of any type – INDEXED, RELATIVE, SEQUENTIAL, or LINE SEQUENTIAL. This problem occurs only under MS-DOS and not under OS/2. Microsoft has confirmed this to be a problem in COBOL versions 3.00 and 3.00a for MS-DOS. This problem has been corrected in Microsoft COBOL Professional Development System version 4.00.

More Information: EXTERNAL files are files that can be shared between programs or subprograms. This article applies only to files that contain the EXTERNAL clause in their FD (file description). For a more detailed description of EXTERNAL files, query on the following words: ANSI and EXTERNAL and file and COBOL This problem was reproduced under MS-DOS versions 3.30 and 4.00. The problem did not occur in a test under MS OS/2 version 1.10.

Code Example
Compile the program below as follows: COBOL ISATEST.COB; LINK ISATEST+EXTERNL+EXTFH+@ADIS.LNK,,,LCOBOL.LIB; The following program demonstrates this problem: $SET ANS85 FILE-CONTROL. SELECT OPTIONAL TMP-REC-1 ASSIGN TO DISK ORGANIZATION IS SEQUENTIAL. SELECT OPTIONAL TEST-REC-2 ASSIGN TO DISK ORGANIZATION IS SEQUENTIAL. SELECT OPTIONAL TEST-REC-3 ASSIGN TO DISK ORGANIZATION IS SEQUENTIAL. SELECT OPTIONAL TMP-REC-4 ASSIGN TO DISK ORGANIZATION IS SEQUENTIAL. SELECT OPTIONAL TMP-REC-5 ASSIGN TO DISK ORGANIZATION IS SEQUENTIAL. SELECT OPTIONAL TMP-REC-6 ASSIGN TO DISK ORGANIZATION IS SEQUENTIAL. DATA DIVISION. FILE SECTION. FD TMP-REC-1 IS EXTERNAL VALUE OF FILE-ID IS “TMP-1.DAT”. 01 TMP-REC-REG. 05 TMP-NUM-1 PIC 9(5). 05 EXTRA-1 PIC X(216). FD TEST-REC-2 IS EXTERNAL VALUE OF FILE-ID IS “TEST2.DAT”. 01 TEST-REC-2-REG. 05 TMP-NUM2 PIC 9(10). 05 EXTRA-2 PIC X(101). FD TEST-REC-3 IS EXTERNAL VALUE OF FILE-ID IS “TEST3.DAT”. 01 TEST-REC-3-REG. 05 TMP-NUM3 PIC 9(14). 05 EXTRA-3 PIC X(216). FD TMP-REC-4 IS EXTERNAL VALUE OF FILE-ID IS “TEST4.DAT”. 01 TMP-REC-4-REG. 05 TMP-NUM4 PIC X(1). 05 EXTRA-4 PIC X(10). FD TMP-REC-5 IS EXTERNAL VALUE OF FILE-ID IS “TEST5.DAT”. 01 TMP-REC-5-REG. 05 TEMP5 PIC X(2). 05 EXTRA-5 PIC X(13). FD TMP-REC-6 IS EXTERNAL VALUE OF FILE-ID IS “TEST6.DAT”. 01 TMP-REC-6-REGS. 05 TMP-NUM6 PIC X(6). 05 EXTRA-6 PIC 9(5). PROCEDURE DIVISION. 0000-MAINLINE. OPEN OUTPUT TMP-REC-1, TEST-REC-2, TEST-REC-3,TMP-REC-4, TMP-REC-5, TMP-REC-6. DISPLAY “IT OPENED O.K.” AT 2501. CLOSE TMP-REC-1, TEST-REC-2, TEST-REC-3, TMP-REC-4, TMP-REC-5, TMP-REC-6. STOP RUN.

Copyright Microsoft Corporation 1990.