Use the STATUS macro to change the dispatchability status of one or all of a program's subtasks. For example, the STATUS macro can be used to restart subtasks that were stopped when an attention exit routine was entered.
The requirements for the caller are:
Environmental factor | Requirement |
---|---|
Minimum authorization: | Problem state and any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN=HASN=SASN or PASN¬=HASN¬=SASN |
AMODE: | 31-bit |
ASC mode: | Primary or access register (AR) |
Interrupt status: | Enabled or disabled for I/O and external interrupts |
Locks: | No locks held. |
Control parameters: | No requirements. |
None.
The caller cannot have an EUT FRR established.
Before issuing the STATUS macro, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.
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.
Using STATUS will degrade performance of the calling program's address space while STATUS runs.
The STATUS macro is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␢ | One or more blanks must precede STATUS. |
STATUS | |
␢ | One or more blanks must follow STATUS. |
START |
|
,TCB=tcb addr | tcb addr: RX-type address or address in register (2) - (12). |
,RELATED=value | value: Any valid macro keyword specification. |
The parameters are explained as follows:
The RELATED parameter is available on macros that provide opposite services (for example, ATTACH/DETACH, GETMAIN/FREEMAIN, and LOAD/DELETE) and on macros that relate to previous occurrences of the same macros (for example, CHAP and ESTAE).
STAT1 STATUS STOP,TCB=YOURTCB,RELATED=(STAT2,
'STOP A SUBTASK')
.
.
.
STAT2 STATUS START,TCB=YOURTCB,RELATED=(STAT1,
'START A SUBTASK')
Return codes from execution of STATUS are as follows:
Hexadecimal Return Code | Meaning and Action |
---|---|
00 | Meaning: Processing completed successfully. Action: No action necessary. |
04 | Meaning: Program error. START/STOP request
failed. The task you specified is not a subtask of the calling program's
task. Action: Ensure that you specify a task on the TCB parameter that is a subtask of the calling program. |
STATUS STOP
PRINT NOGEN
STATUS CSECT
STATUS AMODE 31
STATUS RMODE ANY
*********************************************************************
* The following code performs the following functions: *
* 1. Creates a subtask by issuing the ATTACH macro. *
* 2. Stops the subtask by issuing the STATUS macro with the *
* STOP parameter. *
* 3. Starts the stopped subtask by issuing the STATUS macro *
* with the START parameter. *
* *
*********************************************************************
SPACE 3
***************************************
* Entry linkage *
***************************************
SPACE 3
STM R14,R12,12(R13)
BALR R12,0
USING BEGN,R12
BEGN DS 0H
ST R13,SAVE+4
LA R15,SAVE
ST R15,8(0,R13)
LR R13,R15
EJECT
**********************************************************************
* Attach a subtask and request that it be notified by an ECB when *
* the subtask completes. *
* *
**********************************************************************
SPACE 3
ATTCH1 ATTACH EP=SUBTASK,ECB=AMYECB
SPACE 3
ST R1,TCBADDR SAVE SUBTASK TCB ADDRESS
EJECT
******************************************************************
* Stop the subtask by issuing STATUS STOP, then restart it by *
* issuing STATUS START. *
* *
******************************************************************
SPACE 3
STATUS STOP,TCB=TCBADDR
SPACE 3
.
****************************************************
* Processing of other subtasks continues. *
****************************************************
.
STATUS START,TCB=TCBADDR
SPACE 3
EJECT
*****************************************************
* Wait until subtask completes, then detach it. *
*****************************************************
SPACE 3
WAIT 1,ECB=AMYECB WAIT ON E-O-T ECB
SPACE 3
DETACH TCBADDR DETACH SUBTASK
SPACE 3
EJECT
***************************************
* End of job *
***************************************
SPACE 3
FINI DS 0H
L R13,SAVE+4
DROP R12
LM R14,R12,12(R13)
XR R15,R15
BR R14
EJECT
***********************************
* Define constants *
***********************************
SAVE DC 18F'0'
*
TCBADDR DC F'0' ADDRESS OF SUBTASK TCB
AMYECB DC F'0' END-OF-SUBTASK ECB
EJECT
***********************************************
* Register equates *
***********************************************
SPACE 3
R1 EQU 1
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
LTORG
END