Start/Stop exit (User Exit 0)

User Exit 0 is called when HCL Workload Automation for Z is starting and when it is ending normally. You can use this exit to allocate resources when IBM® Z Workload Scheduler is started and to release them when HCL Workload Automation for Z is stopped. This avoids the extra overheads involved in allocating and then releasing resources each time they are used in other User Exits.

HCL Workload Automation for Z invokes the User Exit 0 in AMODE 31 and RMODE 24.

You can use User Exit 0 to:

Editing the exit

User Exit 0 includes the header file exit0.h, which contains the following routines:
void updateMcaUserF(void *newMcaUserF, struct exit0Struct *params)
To update the address of the mcaUserF field.
int releaseMcaUserF(int size, struct exit0Struct *params)
To release storage allocated in the mcaUserF field. It returns 0. If any error occurs, it returns -1 and a WTO message is issued.

The mcaUserF field must be the address of the resources allocated in the User Exit. The address must be under the 16MB line (24 bit). The params input is the same as the input passed to exit0do.

The header contains also the struct exit0Struct structure, which is provided as an input to the exit0do routine. Each string in the data structure is expanded by 1 character to reserve space for the end-of-text character \0, which corresponds to byte 0.

User Exit 0 parameters

User Exit 0 has the following structure:
struct exit0Struct{
char action[ACTION_LEN+1];
void **mcaUserF;
} ;
#define ACTION_LEN 8
where:
ACTION
Has the value START when the exit is called during HCL Workload Automation for Z startup. MCAUSERF is 0 for this initial call. Normally, this exit performs exit initialization functions for the start call when you start HCL Workload Automation for Z. If the exit needs to allocate storage that is used while HCL Workload Automation for Z is active, you need update MCAUSERF to address this storage with the updateMcaUserF function.

ACTION has the value STOP when the exit is called during HCL Workload Automation for Z termination. Normally, this exit performs exit termination functions for the stop call when you stop HCL Workload Automation for Z. If MCAUSERF is updated by the start call, the same value is passed to the exit for the stop call.