z/OS Communications Server: SNA Programming
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


OPEN and CLOSE errors and special conditions

z/OS Communications Server: SNA Programming
SC27-3674-00

Most ERROR settings indicate an error in program logic or some failure to match the name of an ACB as specified in the program with its name as specified during VTAM® definition. A dump, program termination, and debugging are required. If multiple ACBs are being opened and only some have been opened successfully, it might be possible to continue with the programs whose ACBs are opened.

Register 15 should be tested after the OPEN or CLOSE macroinstruction. If the return code in register 15 is 0, all ACBs have been opened or closed as requested. If the return code does not equal 0, one or more ACBs were not properly opened or closed. When this occurs, the TESTCB macroinstruction can be used to test the OFLAGS field of each ACB to see if it is open:
TESTCB      AM=VTAM,ACB=(3),OFLAGS=OPEN

In this example, the address of an ACB is in register 3. If an OPEN macroinstruction failed (except for the error that occurs when the ACB is opened prior to this OPEN), the failing ACB does not have OFLAGS=OPEN, and the ACB is still closed. If a CLOSE macroinstruction failed (except for the error that occurs when the ACB is closed prior to this CLOSE), the failing ACB has OFLAGS=OPEN because the ACB is not closed. Once the failing ACB has been located, the SHOWCB macroinstruction can be used to look at the error bits in the ERROR field of the ACB. Of course, neither the OFLAGS nor the ERROR field can be examined if OPEN originally pointed to an area that did not contain an ACB.

See Conventions and descriptions of VTAM macroinstructions, for the description of the format and contents of the ERROR field in the OPEN and CLOSE macroinstruction. Figure 1 shows how OPEN/CLOSE error and special-condition information is organized.

Figure 1. How OPEN/CLOSE error and special-condition information is organized
The diagram shows after OPEN or CLOSE, return code 0 in register 15 indicates the OPEN or CLOSE is successful; otherwise, it is unsuccessful. If OPEN or CLOSE fails, the OFLAGS field shows whether each specified ACB is opened or closed and the ERROR field indicates the reason that the specified ACB is not opened or closed.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014