OPEN return codes

When your program receives control after issuing an OPEN macro, the return code in register 15 indicates if all the data sets were opened successfully. OPEN can fail with a non-zero return code and a message, but no ABEND.

The OPEN return codes are:

Return Code (15) Meaning
0(X'0') All data sets were opened successfully and DCBOFOPN (bit 3 of DCBOFLGS) for each DCB is 1.
Note: If the application has a DCB ABEND EXIT, and that exit ignores an open determinate abend, then open will get a return code=0 even though the dcb is not open. the application should check DCBOFOPN to see if the dcb really is open in that case.
4(X'4') All data sets were opened successfully, but one or more attention messages were issued.
8(X'8') At least one data set (VSAM or non-VSAM) was not opened successfully; the ACB or DCB was restored to the contents it had before OPEN was issued; or, if the data set was already open, the ACB or DCB remains open and usable and is not changed.
12(X'C') A non-VSAM data set was not opened successfully when a non-VSAM and a VSAM data set were being opened at the same time; the non-VSAM data control block was not restored to the contents it had before OPEN was issued (and the data set cannot be opened without restoring the control block).
16(X'10') One or more of the access method control blocks (ACBs) specified the RLS option but the system has not been set up for RLS (the SMSVSAM server address space is not available). For other DCBs and ACBs any condition described by other return codes is possible.