Previous Topic: #SENDMSG ExampleNext Topic: #SNAP


#SETIME

The #SETIME statement defines an event that is to occur after a specified time interval or cancels the effect of a previously issued #SETIME request. The following time-related events can be defined:

Syntax

►►─┬─────────┬─ #SETIME TYPE= ─┬─ WAIT ────┬──────────────────────────────────►
   └─ label ─┘                 ├─ POST ────┤
                               ├─ STRTASK ─┤
                               └─ CANCEL ──┘

 ►─┬────────────────────────────────────────┬─────────────────────────────────►
   └─ ,PLIST= ─┬─ SYSPLIST ◄ ─────────────┬─┘
               └─ parameter-list-pointer ─┘

 ►─┬────────────────────────────────────────────┬─────────────────────────────►
   └─ ,INTVL=time-before-action-taken-register ─┘
 ►─┬─────────────────────────┬────────────────────────────────────────────────►
   └─ ,ECB=post-ecb-pointer ─┘

 ►─┬──────────────────────────────────┬───────────────────────────────────────►
   └─ ,TSKCD=start-task-code-pointer ─┘

 ►─┬──────────────────────────┬───────────────────────────────────────────────►
   └─ ,PRI=priority-register ─┘
 ►─┬──────────────────────────────────────────────┬───────────────────────────►
   └─ ,DATADDR=start-task-data-location-register ─┘

 ►─┬────────────────────────────────────────────┬─────────────────────────────►
   └─ ,DATALEN=start-task-data-length-register ─┘

 ►─┬─────────────────────────────────┬────────────────────────────────────────►
   └─ ,ICEADDR=ice-address-register ─┘

 ►─┬────────────────────────────────┬─────────────────────────────────────────►◄
   └─ ,ICNFXIT=ice-not-found-label ─┘

Parameters

TYPE=

Requests that the system establish a time-related event or cancels a previously requested time-dependent action.

WAIT

Places the issuing task in a wait state and instructs the system to redispatch the issuing task after the specified time interval elapses. A subsequent #SETIME request cannot be used to cancel this event until the time interval has elapsed.

POST

Posts an ECB after the specified time interval elapses. The issuing task continues to run. The ECB is specified using the ECB parameter (described below).

Note: The POST instruction will only POST an ECB that is within storage owned by the TASK initiating the POST instruction. If the storage is not owned by the same task, it will not be executed.

STRTASK

Initiates a task after the specified time interval elapses. The task is specified using the TSKCD parameter (described below).

CANCEL

Cancels the effect of a previously issued #SETIME request. If CANCEL is specified, the ICEADDR parameter (described below) must also be specified.

PLIST= Specifies the location of the six-fullword storage area in which the system builds the #SETIME parameter list.

SYSPLIST

(Default); is the symbolic name of the storage area in which the system builds the parameter list.

parameter-list-pointer

Is a register that points to the area in which the system builds the list or the symbolic name of that area.

INTVL= (WAIT, POST, STRTASK requests only); specifies when the event is to occur. The interval is the amount of time in seconds between when the #SETIME request is issued to when the requested event is to occur.

time-before-action-taken-pointer

A register that contains the time interval, the symbolic name of a user-defined field that contains the time interval, or an absolute expression.

Note: For efficiency reasons, the time when the event is to occur is calculated by adding the INTVL value to the time at which the last TICKER interval expired. Therefore, the actual interval before the event occurs may vary plus or minus from INTVL by an amount up to the TICKER interval. For more information about the TICKER interval, see the System Generation Guide.

ECB= (POST only); specifies the location of the ECB to be posted.

post-ecb-pointer

A register that points to the ECB or the symbolic name of a user-defined field that contains the ECB. The ECB is an internal ECB which is three (3) fullwords in length and should be initialized with nulls.

TSKCD= (STRTASK only); specifies the 1- to 8-character task code of the task to be initiated.

start-task-code-pointer

A register that points to the task code, the symbolic name of a user-defined field that contains the task code, or the task-code literal enclosed by single quotation marks. The specified task code must have been defined during system generation or defined dynamically using the DCMT VARY DYNAMIC TASK command.

PRI= (STRTASK only); specifies a dispatching priority for the task to be initiated.

priority

A register that contains the priority or an absolute expression Valid codes are 0 through 240. The task's priority defaults to the priority defined for the task either during system generation or at dynamic definition using the DCMT VARY DYNAMIC TASK command.

DATADDR= (STRTASK only); identifies the user data to be passed to the new task.

start-task-data-location

A register that points to the data or the symbolic name of a user-defined field that contains the data. A register that points to the data or the symbolic name of a user-defined field that contains the data. The DATALEN parameter must be specified with DATADDR.

When the new task is started, the first program receiving control can access the data area (parameter list) through register 1. Register 1 will contain the address of a halfword which contains the value specified in DATALEN. This halfword will be followed by the data.

DATALEN= (STRTASK,DATADDR only); specifies the length, in bytes, of the data area identified by start-task-data-location.

start-task-data-length-register

A register that contains the length, the symbolic name of a user-defined field that contains the length, or an absolute expression.

ICEADDR= (POST, STRTASK, CANCEL only); specifies the address of the interval control element (ICE) associated with the time event.

POST or STRTASK

The optional ICEADDR parameter specifies the location to which the system returns the ICE address.

ice-address-register

A register or the symbolic name of a fullword user-defined field. name of a fullword user-defined field.

Note: The ICEADDR parameter must be specified with POST and STRTASK requests if the program is to issue subsequent #SETIME TYPE=CANCEL requests.

CANCEL

The ICEADDR must be specified. The ICEADDR references the location that contains the ICE address following a previously issued POST or STRTASK request.

ICNFXIT=ice-not-found-label (CANCEL only); specifies the symbolic name of the routine to which control should be returned if the ICE referenced by the ICEADDR parameter cannot be found. If ICNFXIT is not specified, control returns to the next sequential instruction following the #SETIME statement.

Examples

The #SETIME statement shown below requests that the system initiate the task labeled TSK01 sixty seconds after the #SETIME request is issued:

#SETIME TYPE=STRTASK,TSKCD='TSK01',INTVL=60

Status Codes

The #SETIME request is unconditional. Error conditions that can occur are described below:

After completion of the #SETIME request, the value in register 15 indicates the outcome of the operation. Register 15 values are significant only for requests that cancel a previously issued #SETIME request.

The following is a list of Register 15 values and the corresponding meaning:

X'00'

The request to cancel a previously issued #SETIME has been serviced successfully.

X'04'

The request to cancel a #SETIME request cannot be serviced because the specified ICE address cannot be found.

X'08'

The specified task code is not known to the DC/UCF system.