The MGCR macro starts a program or subsystem from within your program and passes 31 bits of information, in the form of a token, to the started program. The MGCR macro can also issue a reply to a WTOR macro. In other words, use MGCR to issue an internal START or REPLY command.
The requirements for the caller are:
Environmental factor | Requirement |
---|---|
Minimum authorization: | Supervisor state and PSW key 0-7 |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN=HASN=SASN |
AMODE: | 24- or 31-bit |
ASC mode: | Primary |
Interrupt status: | Enabled for I/O and external interrupts |
Locks: | No locks held |
Control parameters: | Must be in the primary address space |
You can use MGCR to issue only START or REPLY commands. You must use MGCRE for any other commands.
Some callers depend on register contents remaining the same before and after issuing a service. If the system changes the contents of registers on which the caller depends, the caller must save them before issuing the service, and restore them after the system returns control.
None.
The MGCR macro is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␢ | One or more blanks must precede MGCR. |
MGCR | |
␢ | One or more blanks must follow MGCR. |
command-buffer-address | command-buffer-address: RX-type address or register (1) or (2) - (12). |
The parameters are explained as follows:
Name | Length | Contents |
---|---|---|
flags1 | 1 byte | If bit 0 is one, then flags2 must contain meaningful information. Bits 1-7 must be zero. |
length | 1 byte | Length of the buffer up to but not including the program token field. |
flags2 | 2 bytes | X‘0000’ - neither a program token nor a user |
text | up to 126 bytes | Command, operands, and optional comments as follows: command operands comments |
ptoken | 31 bits right-justified | An optional field containing any desired information, such as an identifier that indicates the issuing program. |
utoken | 80 bytes | Indicates which user security token the system takes to use for a command issued from an MCS console. The possibilities are console, CTAS, *FAIL, or “undefined-user” ACEE. |
MGCR might abnormally terminate with abend code X'D22'. See z/OS MVS System Codes for an explanation and programmer response for this code.
Register 15 contains one of the following hexadecimal return codes as the result of a START command. No return codes result from the REPLY command.
Return Code | Meaning and Action |
---|---|
00 | Meaning: The START command processed successfully.
Register 0 contains the right-justified ASID of the started address
space. Action: None. |
04 | Meaning: A START command was suppressed
by the SSI or a command exit. Register zero does not contain a valid
ASID; instead it contains all zeros. Action: None. |
08 | Meaning: Environmental error. The START
command failed for one of the following reasons:
Action: Check to see if the START command specified a console that is not authorized for entering the command, and correct the situation if necessary. Next, retry the request. If the problem persists, record the return code and supply it to the appropriate IBM support personnel. |
ISSUMGCR EQU *
XC MGCRPL(MGCRLTH),MGCRPL Clear the parameter list
MVC MGCRTEXT(L'TXTINSRT),TXTINSRT Move in the reply buffer
MVC REPLY,CTXTRPID Insert the reply ID
LA REG1,(MGCRTEXT-MGCRPL)+L'TXTINSRT Get MGCRPL length
STC REG1,MGCRLGTH Save length in the MGCRPL
SR REG0,REG0 Clear register zero
MGCR MGCRPL Issue the command
.
.
.
IEZMGCR DSECT=NO Mapping of MGCR parameter list
ORG MGCRTEXT
COMMAND DS CL6 Storage for REPLY verb
REPLY DS CL2 Reply ID
REPLYMSG DS CL3 WTOR response
ORG