Create macros

An operational program can create independent entries and assign one of four priorities for initiating the processing of the entry. The create macros available to the operational programs are:
CREDC
Create a deferred entry
CREMC
Create an immediate entry
CRETC
Create time initiated entry
CREXC
Create a low-priority deferred Entry
CREEC
Create an immediate entry with a core block
CRESC
Create a synchronous entry

Entries that are created by the CREDC, CREMC, CRETC, CREXC, CREEC, and CRESC macros are created in the same subsystem and for the same subsystem user as the program that created them. Additionally, entries that are created by the CREDC, CREMC, CREXC, and CREEC macros are started on the same I-stream as the program that created them. Entries that are created by the CRETC macro are started on the same I-stream as the program that created them if the I-stream is in use. If the I-stream is collapsed, entries that are created by the CRETC macro are started on the main I-stream.

Use the CREDC macro to create an entry and defer its processing to a nonpeak period. The operational program has the ability to initialize the created ECB work area with as many as 96 bytes of parameter information. These parameters can be set up at execution time because the address and byte count of the parameter area is specified in scratch registers R14 and R15. The control program buffers the parameters in an available main storage block and adds this block to the deferred list. When the deferred list is serviced, operational program zero (OPZERO) gets an ECB, moves the parameters into the work area, and releases the interim main storage block. At this time an enter with no return (ENTNC) macro is processed, transferring control to the program specified by the CREDC macro. It is important to understand that the repeated use of the CREDC macro can cause a depletion of main storage. When there is insufficient storage to buffer the parameters, the control program forces the ECB that issues the CREDC macro into a WAITC. The macro is processed when the necessary main storage becomes available.

The CREMC macro is similar to the CREDC macro except that the interim main storage block buffering the parameters is added to the postinterrupt list. Because excessive use of the CREMC can lock out input messages to the system, this macro should be used carefully.

Operational programs that run in a machine state higher than 1052 state can create time-initiated entries by executing the CRETC macro. The control program remembers this request and transfers control to the specified program at the correct time. An ECB is assigned to the created entry when the new program is started. A control block can be passed to the created entry using the LEVEL parameter. The CRETC macro differs from the CREMC and CREDC macros in that the CRETC parameter area is limited to one word, which appears as the first word of the work area in the created ECB. The time interval (3 bytes), in minutes or seconds, that indicates the time relative to the present time, must be specified by the operational program. Both the time interval and the action word are dynamic parameters in that they are set up at execution time in scratch registers R14 and R15. The information required by the control program to retrieve the specified program is specified in the macro expansion.

The CREXC macro is similar to the CREDC macro, but it is more specialized in that it requires more main storage blocks to be available before it will execute. It should be used by programs that create many entries. The use of this macro by doing many creates ensures that there is no degradation of the real-time system by a created shortage of main storage blocks.

The CREEC macro is similar to CREDC and CREMC usage and processing with the additional capability of passing a core block to level zero of the created entry control block. The operational program specifies whether a deferred or immediate entry is to be created and follows the processing paths of CREDC and CREMC, respectively.

Use the CRESC macro to create a synchronous entry. The issuing program can specify a timeout value to indicate how long the program will wait for the created entry to end. When exiting, the created entry will notify the issuing program by posting completion of an event for which the program is waiting. The issuing program can create as many as 50 entries by coding multiple CRESC macros that specify WAIT=NO, followed by a CRESC WAIT=YES call. The program can pass as much as 4 KB of data to each created entry and can specify on which I-stream to start the entry.

Note: Limit the use of this macro to prevent storage depletion.