Return Codes

Conversational Monitor System (CMS): A return code of zero is passed to register 15 if no warning messages, error messages, severe error messages, or terminal error messages are generated during execution of a command.

If however, during execution of a command, a condition arises that results in the display of a warning message, error message, severe error message, or terminal error message, the command passes a nonzero return code to register 15.

Commands that invoke program products pass a nonzero return code to the user. This return code has been redefined by the program product or compiler in operation.

Table 1 lists the return codes issued by CMS commands. However, it does not contain all issued return codes. Additional return codes are shown in the descriptive text of the issuing message.
Table 1. Return Codes Issued by CMS Commands
Return code Meaning
-0001 No CP command with this name was found. (The CP error code of +1 is converted by CMS to -0001 for commands entered from the virtual console.)
-0002 An attempt was made to execute a CMS command while in CMS subset mode, which would have caused the module to be loaded in the user area (LOADMOD error code 32).
-0003 No CMS command issued from EXEC was found with this name, or an invalid function occurred when the SET or QUERY command was issued from EXEC with IMPCP active.
-0004 The LOADMOD failed (for example, there was an error in the module).
-0005 A LOADMOD was attempted in the wrong environment (for example, the module was generated by the GENMOD command with the OS option, and LOADMOD was attempted with DOS=ON specified).
-0006 An attempt was made to invoke a CMS function or macro from the command line (or from a REXX/VM exec through an ADDRESS CMS or &PRESUME &SUBCOMMAND CMS).
-0007 The command is not valid for mixed case file id.
-0014 SVC resulted in an implicitly created process that abended before completion.
-0015 A multitasking program was invoked while CMS/DOS mode was active.
4 The user did not specify all the conditions necessary to execute the command as intended. Execution of the command continues, but the result may or may not be as the user intended.
6 The command completed successfully, but the requested data was not found. For example, the QUERY LOCK command returns this only when the STACK or XEDIT options are specified and no locks are outstanding.
8 Device errors occurred for which a warning message is issued, or errors were introduced into the output file.
12 This code was returned for one of the following reasons:
  • Errors were found in the input file.
  • The user does not have permission to access the byte file system.
  • The byte file system is mounted read only.
20 There was a character in the file ID or path name that was not valid. Valid characters are: 0-9, A-Z, $, @, #, a-z, +, - (hyphen), : (colon), and _ (underscore). A window name of * or = is not allowed. Path names can not contain X'00'.
24 This code was returned for one of the following reasons:
  • The user did not correctly specify the command line.
  • CMS virtual screen or window cannot be deleted.
  • The path name is not valid.
28 An error occurred while the system tried to access or manipulate a user's files or Virtual screen, window or queue not defined. Also, file not found or already exists, directory not found or already exists, or insufficient authority.
30 The CALLTYP parameter is required with the invocation of PARSECMD.
31 An error occurred while trying to access an SFS file, and a rollback occurred on the default work unit ID.
32 This code was returned for one of the following reasons:
  • The user's file was not in the expected format.
  • The user's file did not contain the expected information,
  • An attempt was made to execute a LOADMOD command while in CMS subset mode. This caused the module to be loaded in the user area.
  • Position specified is not valid.
  • File is not a BFS regular file.
36 This code was returned for one of the following reasons:
  • An error occurred in the user's devices. For example, a disk or directory was not accessed or was in read-only status, and needed to be in write status in order to write out a file
  • Window not connected or displaying virtual screen.
  • No field to write data/color/exthi/PSset.
  • A byte file system is mounted read-only. You cannot write to it.
38 Invalid reentry into a module.
40 A functional error for which the user is responsible occurred during execution of the command, or the user failed to supply all the necessary conditions for executing the command or end of file, end of tape (where applicable).
41 Insufficient storage was available for execution of the command.
44 Shared segment not available.
50 A file was migrated by DFSMS/VM and will not be implicitly recalled.
51 A DFSMS/VM related error occurred during file creation or recall.
55 Communications error. This can be for IUCV, APPC/VM, TCP/IP, and so on.
64 Architecture conflict.
68 Conflicting AMODE/RMODE.
70 File sharing conflict. This includes locking conflicts and failures caused by uncommitted changes.
74 Requested function not valid for minidisks.
76 Authorization error. The user doesn't have the authority to do the request.
80 An I/O error occurred while an OS data set or DOS file was being read or an OS or DOS disk was detached without being released.
81 The file is an OS read-password-protected data set or a DOS file with the input security indicator on.
82 The OS data set or DOS file is not BPAM, BSAM, or QSAM.
83 The OS data set or DOS file has more than 16 user labels or data extents.
84 The OS data set is unsupported.
88 A CMS system restriction prevented execution of the command, or the function requested is an unsupported feature, or the device requested is an unsupported device or a TTY device.
99 A required system resource is not available or not installed. This could mean that the CSL library is not installed, or perhaps the server is unavailable for some reason.
100 Input/output device errors.
104 A functional error for which the system is responsible occurred during execution of the command or insufficient storage.
256 All unexpected errors for which the system is responsible (Terminal Error) occurred during execution of the command or request rejected by IUCV.

Callable Services Library (CSL)

Table 2 lists the return codes issued by all CMS file system management (file pool and minidisk I/O) CSL routines, file pool administration routines, and many other routines in the VMLIB callable services library.
Table 2. Return Codes Issued by All CMS File System Management CSL Routines, File Pool Administration Routines, and VMLIB CSL Routines
Return code Meaning
0 The operation was successful.
4 The operation was successful, but a warning condition was encountered.
8 The operation was unsuccessful.
12 The operation was unsuccessful, and the current work unit was rolled back.
Note: When the return code is 8, the work unit may still be considered active even though the request failed. Before an application can issue an atomic program function on the same work unit for the same file pool, it must first issue a commit or rollback request for that work unit.
Table 3 lists the return codes issued by the commit (DMSCOMM) routine and all VMLIB routines with the COMMIT option.
Table 3. Return Codes Issued by the DMSCOMM and all VMLIB Routines with the COMMIT Option
Return code Meaning
16 The work was committed, but the state may not be consistent. See the associated reason code.
20 The work was rolled back, but the state may not be consistent. See the associated reason code.
Table 4 lists the return codes issued by the rollback (DMSROLLB) routine.
Table 4. Return Codes Issued by the DMSROLLB Routine
Return code Meaning
12 Rollback was successful; however, the rollback was caused by an event such as a failure of one of the protected resources.
20 Rollback was successful, but one or more protected resources may have committed changes.
Table 5 lists the return codes issued by the file pool storage use exit (DMSSFSEX) routine.
Table 5. Return Codes Issued by the DMSSFSEX Routine
Return code Meaning
5 The requested function is not supported by the exit called. Further calls to the exit for this file pool function are suppressed. The file pool server takes its default action.

Some VMLIB routines issue their own special return codes. These are included in the description of each routine.

Table 6 lists the return codes issued when a calling interface (direct call, DMSCSL, CSLFPI macro, REXX CSL function, or REXX ADDRESS OPENVM statement) encounters a problem, such as parameters not matching what is in the template file. These codes are returned in the retcode parameter. (Codes from ADDRESS OPENVM are returned in the REXX RC variable.)
Table 6. Return Codes Issued When a Calling Interface Encounters a Problem
Return code Meaning
-07 Routine not loaded.
-08 Routine has been dropped.
-09 Insufficient virtual storage available.
-10 Too many parameters specified.
-11 Not enough parameters specified.
-12 CSL does not exist on the release. (Issued only for DMSCSL and CSLFPI calls on releases VM/SP 5, XA/SP 1.1, and XA/SP 1.2.)
-13 (Not issued for CSL calls from REXX.)
DMSCSL call
Parameter list format is not valid (returned in register 15 only).
Direct call
The Call Routing Code Segment used was not valid. The segment has incorrectly specified the multiprocessing capability of rtnname. The capability of the current routine version is not what was specified by the Call Routing Code Segment. The call cannot be completed.
CSLFPI call
CSLFPI fast path area cannot provide parameters in the standard plist format required by the currently loaded routine version.
-20 Error encountered while calling a CSL routine using REXX: call is not valid.
-22 Error encountered while calling a CSL routine using REXX: REXX argument is not valid.
-23 Error encountered while calling a CSL routine using REXX: a subpool create failure occurred.
-24 Error encountered while calling a CSL routine using REXX: a REXX fetch failure occurred.
-25 Error encountered while calling a CSL routine using REXX: a REXX set failure occurred.
-26nnn Error encountered while calling a CSL routine using REXX: the data length was incorrect for parameter number nnn.
-27nnn Error encountered while calling a CSL routine using REXX: the data or data type was incorrect for parameter number nnn.
-28nnn Error encountered while calling a CSL routine using REXX: the variable name was incorrect for parameter number nnn.
-29nnn Error encountered while calling a CSL routine using REXX: the length value specified was incorrect (for example, a negative value) for length parameter, parameter number nnn.

For more information about return codes -26nnn through -29nnn,

For return codes from the REXX ADDRESS CPICOMM or ADDRESS CPIRR statement,

CMS Extract/Replace Facility

For return codes produced by the CMS extract/replace facility, see the z/VM: CMS Macros and Functions Reference.

Control Program (CP) DIRECTXA Command

Table 7 lists the return codes issued by the DIRECTXA utility.
Table 7. Return Codes Issued by the DIRECTXA Utility
Return code Meaning
0 DIRECTXA processed successfully. The real CP directory has been updated (unless the EDIT option was specified).
1 A directory source file was not found on an accessed disk.
2 An error was encountered while processing a directory source file.
3 A not valid option was specified on the DIRECTXA command line.
4 No errors were encountered, but you do not have the proper privilege class to update the real CP directory.
5 Condition code 1 was received from DIAGNOSE X'3C', which means a class A, B, or C user updated a virtual directory.
6 Condition code 2 was received from DIAGNOSE X'3C', which means a nonvalid directory pointer was found in the volume label.
7 Condition code 3 was received from DIAGNOSE X'3C', which means a fatal I/O error occurred.
9 The directory has been rewritten, but warning messages have been issued.
> 100 Return codes greater than 100 may be returned accompanied by message 764—except for code 333, which will not be accompanied by message 764. See the explanation for message 764 for details on these return codes.
333 DIRECTXA was run in EDIT mode, and at least one password was changed to NOLOG.

Produced by CP

Figure 1 shows an example of the CP LINK command invoked from CMS mode. Commands or functions of commands passed to CP, in turn, pass the return code (through CP) to register 15.
Figure 1. Example of a CP LINK Command
ipl cms z/VM
CMS - mm/dd/yy hh:mm
-------------------------------
-------------------------------
cp link to * vaddr1 as vaddr2 r

The user has entered the CP LINK command to user ID *. The user's own directory will be searched for device vaddr1. The virtual address assigned to the device for this virtual machine is vaddr2. Read-only access is requested. No password is required because the user has linked to one of his own disks.

The result will be one of the following:
Ready;
A successful execution
R(nnnnn);
Indicating an error (where nnnnn is the return code).

Return codes can be used by system programmers in REXX/VM. See z/VM: REXX/VM Reference for a description of the &RETCODE special variable.

The return codes associated with each command directly correspond to the message numbers. For example, if you received a return code of 22 when executing the LINK command, you could look at the description for message number HCP022E:
  • HCPLNM022E A virtual device number was not supplied or it was invalid

CMS DDR Command

The CMS DDR command produces several return codes. These return codes along with their meanings are listed in z/VM: CP Commands and Utilities Reference.

APPC/VM VTAM® Support (VS)

AVS generates several return codes.
  • For return codes generated while processing APPCCMD macros, see VTAM Programming for LU 6.2, SC31-6410.
  • For return codes generated while processing APPCVM and IUCV macros, see z/VM: CP Programming Services.
  • For return codes generated while processing IUCVCOM and IUCVIMI macros, see z/VM: Group Control System.

Virtual Machine Service Enhancements Staged/Extended (VMSES/E) Commands

Table 8 lists the return codes issued by VMSES/E commands.
Table 8. Return Codes Issued by VMSES/E Commands
Return code Meaning
0 Command completed successfully.
2 Command completed successfully, but extraneous data was encountered or additional action might be required.
4 Command completed with one or more warning conditions.
5 Command processing stops.
6 Command processing stops.
8 Command completed, but at least one major process failed.
9 Command processing stops.
12 Command failed because of an internal error.
13 Command processing stops.
21 Command processing stops.
24 Command failed because of a command-line syntax error.
28 Command failed because a required file was not found.
32 Command processing stops.
33 Command processing stops.
34 Command processing stops.
35 Command processing stops.
36 Command failed because a target disk or directory was not available.
40 Command processing stops.
90 Command processing stops.
97 Command processing stops.
98 Command processing stops.
99 Command processing stops.
100 Command failed because of an external error.
500 User terminated the command from a prompt.
4113 Command processing stops.