Microsoft KB Archive/44760

\serverfor Network Files Not Supported in COBOL 3.0

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

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

Summary: The Microsoft COBOL Compiler Versions 3.0 and 3.0a do not support the “\server” method of referencing a file over a network. However, this method is supported in COBOL Versions 2.0, 2.1 and 2.2. As a workaround, assign a logical drive (e.g. Q:) to the server and share that you want to access; then, refer to the file with the logical drive (e.g. Q:TEST.DAT).

More Information: The \servermethod is a standard method of referencing files on the IBM PC-NET and MS-NET. This method is supported in earlier COBOL versions because the only network supported was IBM PC-NET. Now that COBOL 3.0 and 3.0a support other networks that use different referencing systems, the \servermethod was excluded from COBOL 3.0 and 3.0a.

Code Example
The following code example runs correctly in COBOL 2.0, 2.1 and 2.2, but it causes a run-time error 004 “Illegal filename” in COBOL 3.0 and 3.0a: IDENTIFICATION DIVISION. PROGRAM-ID. NETTEST. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN TO DISK ACCESS IS SEQUENTIAL. DATA DIVISION. FILE SECTION. FD TEST-FILE LABEL RECORDS ARE STANDARD VALUE OF FILE-ID IS “\server.DAT”. 01 TEST-REC PIC X. PROCEDURE DIVISION. 000-MAIN. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN.

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