Microsoft KB Archive/63927

No OS/2 API Function Support for Named Pipes in COBOL 3.0a

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

3.00 3.00a 4.00 OS/2

Summary: The version of DOSCALLS.LIB that comes with Microsoft COBOL Compiler versions 3.0 and 3.0a for MS OS/2 does not support calls to the OS/2 API functions that implement “named” pipes. To resolve external references to those API functions, COBOL modules can be linked with the version of DOSCALLS.LIB that comes with OS/2. This version supports all OS/2 API function. Note that “anonymous” pipes are supported by the COBOL version of DOSCALLS.LIB. Therefore, a call to the API function DosMakePipe should link without any problem. Note that Microsoft COBOL Professional Development System (PDS) version 4.0 for MS OS/2 comes with a file named OS2.LIB that takes the place of DOSCALLS.LIB, and OS2.LIB does support named pipes. Therefore, linking with the OS/2 version of DOSCALLS.LIB is not necessary in COBOL 4.0. A separate article found with the following query describes how to use named pipes in COBOL 4.0: COBOL and named and pipes

More Information: Because the COBOL version of DOSCALLS.LIB does not support named pipes, any calls to the following API functions should generate an “unresolved external” error: DosCallNmPipe DosConnectNmPipe DosDisConnectNmPipe DosMakeNmPipe DosPeekNmPipe DosQNmPHandState DosQNmPipeInfo DosQNmPipeSemState DosSetNmPHandState DosSetNmPipeSem DosTransactNmPipe DosWaitNmPipe To remedy the situation, link with the OS/2 version of DOSCALLS.LIB. The name of this library may change in future versions of OS/2; in fact, a common name for it among some other high-level languages (such as BASIC and C) is OS2.LIB.

About Pipes
An OS/2 pipe is an area of memory that processes can use to communicate with one another. Using them is similar to performing device I/O, and in fact, some of the same API functions are used [for example, DosOpen, DosRead, DosWrite, DosClose]. An “anonymous” pipe can be used only by related processes; that is, between a parent and its direct descendants. Named pipes have the added feature of being accessible by unrelated processes running on different machines on a local area network.

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