Before issuing a message to a specific console, you might want
to validate if it has been defined. An active console is one that
is defined and running. An application can use the CnzConv or CONVCON
macro to obtain the console status (active or inactive) and the active
system name, with an input console name or ID.
Using CnzConv: To obtain the console status
and active system name of an input console name or ID, do the following
steps:
- Clear the CnzConv parameter list by setting it to zeros.
- Specify the following parameters:
- CnzConv InConsoleName=MyConsoleName or CnzConv InConsoleId=MyConsoleId,
depending on what information you currently have
- ConsoleStatus=OutConsoleStatus
- SysName=OutSysName
- Rtncode=CnzConvReturnCode
- Rsncode=CnzConvReasonCode
- Issue the CONVCON macro.
When CnzConvReturnCode is equal to CnzConvRc0_Ok, the input console
name or id is defined. If OutConsoleStatus is equal to CnzConv_kStatus_Active,
OutSysName contains the system on which the console is active.
Using CONVCON: To obtain the console status
and active system name of an input console name or ID, do the following
steps:
- Clear the CONVCON parameter list by setting it to zeros.
- Initialize the following fields in the parameter list:
- The version ID (CONVVRSN)
- The acronym (CONVACRO)
- Either the console name (CONVFLD) or the console ID (CONVID) depending
on what information you currently have. The installation defines console
names at initialization time in the CONSOLxx member of Parmlib. You
can use the DISPLAY CONSOLES command to receive a list of defined
names.
- The appropriate flag in CONVFLGS indicating whether you are specifying
the console name (CONVPFLD) or the ID (CONVPID) as input.
- Issue the CONVCON macro.
When CONVCON completes, CONVSYSN contains the name of the system
to which the console is attached, if the console you specified is
active. Register 15 contains a return code. If you receive the following
return codes, check the reason code in CONVRSN for an explanation.
- Return code 0 indicates that the console name or ID is valid and
the console is active.
- Return code 4 indicates that the name or ID is valid, but the
console is not active.
- Return code 8 indicates that the console name is incorrect.
- Return code 0C indicates that the console ID is incorrect.
See z/OS MVS Programming: Assembler Services Reference ABE-HSP for an explanation of
all return codes.