INTUSR DOES NOT WORK TO INITIALIZE $USERx

Document ID : KB000004632
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

INTUSR option does not work to initialize $USERx in a user exit (CAZ1XDD, CAZ1XSTE, CAZ1XEXE ... etc )

Resolution:

The INTUSR option is only useful when JCLCHECK is called from another program. The program calling JCLCHECK puts a value into the parameter list that JCLCHECK will copy into those user fields. You are executing PGM=JCLCHECK so you get binary zeros in those user fields.

Additional Information:

Suggestion: Check for $USER4 being zero and if zero then it is the first call so you GETMAIN storage and save the address of the storage in the $USER4 field for the next time the exit is called. You could replace this:

L R5,$USER4

with:

ICM R5,B'1111',$USER4
BNZ GOODU4
GETMAIN R,LV=length
LR R5,R1
XC 0(length,R5),0(R5) Clear to binary zeros
ST R5,$USER4 Save for future calls
GOODU4 DS 0H

Note: This code has NOT been tested. It is sample code only.

I would also suggest adding an eyecatcher at the beginning of the USER4WS to aid in problem diagnostics, for example:

USER4WS DSECT
U4EYE DS CL8'USR4XEXE' Eyecatcher for dumps

And add code to set this field like: "MVC U4EYE,=CL8'USR4XEXE'