The current user for a job is not always the signed-on user. For example, if your job includes a profile swap to another profile (using the swap APIs), the current user can be set to a different user than the one who is signed on. Using the RTVJOBA command, you can retrieve both the Job User and the Current User.
RTVJOBA USER(&USER) CURUSER(&CURUSER)
Those of you that have upgraded to V5R4 have probably seen the change on the WRKACTJOB(Work with Active Jobs) display in which the current user is shown and you need to toggle F11 to see the job user. This is especially noticeable on server jobs that often switch the current user of the job.
In V5R3 and prior, the System Request functions and PreSystem Request exit programs run under the authority of the current user of a job. In V5R4 (or with the application of V5R3 PTF SE21256), the System Request Key functions and PreSystem Request exit program run under the job user instead of the current user. To continue to have the current user profile used (as in prior releases), you'll need to create a data area with the following command:
CRTDTAARA DTAARA(QSYS/QWTSRQSSEC) TYPE(*CHAR) LEN(12) VALUE(*NOCHGCURUSR)
In V5R3 and prior, if you are using a default error handling program or a message queue break handling program, the current user for the job will be used. In V5R4, a change has been made to cause these programs to run under the job user instead of the current user. To continue to have the current user profile used in these cases, you must create a data area. To keep the old method of current user for break-handling programs, create a data area with the following command:
CRTDTAARA DTAARA(QSYS/QMHBRKPSEC) TYPE(*CHAR) LEN(12) VALUE(*NOCHGCURUSR)
To keep the old method on default-handling programs, create a data area with the following command:
CRTDTAARA DTAARA(QSYS/QMHDFTPSEC) TYPE(*CHAR) LEN(12) VALUE(*NOCHGCURUSR)