ibm-midrangejt400

JT400 uses QUSER. Is there a way to change this?


I´m trying to call a RPG-program in a Java application, using the jt400 lib. The call itself is working but the problem is, that the RPG-program uses the userid from the program status data structure to resolve the email adress. Using the JT400 Lib, it shows "QUSER" as userid and not the current user.

How can i change this?


Solution

  • That depends on which User ID field the program is using. It probably is using the one at position 254. That is part of the qualified job name, and cannot be changed. If it were using the one at position 358, the Current User, then it should be the user that logged on.

    All ODBC/JDBC server jobs are started by the same user 'QUSER'. Even if you changed that to your user profile, assuming your user profile had appropriate authority, then every job would be started with your user profile, and not the one that signed in to the ODBC/JDBC connection.

    The only fix is to use the correct field. Otherwise no server job calling this program will ever see the current user's user id.


    Here is an example ODBC/JDBC job that I am connected to:

    Job:   QZDASOINIT     User:   QUSER          Number:   002766
    
    Status of job . . . . . . . . . . . . . . . :   ACTIVE       
    Current user profile  . . . . . . . . . . . :   MMURPHY      
    

    QZDASOINIT is an ODBC/JDBC server job. User: shows the value in position 254 of the PSDS. Current user profile shows the value in position 358 of the PSDS.

    NOTE: This is a pre-start job. When it starts up, and before anyone has connected to it, Current user profile is QUSER. For interactive jobs both the job user, and the current user are the same, so using position 358 of the PSDS vs. position 254 will not break those jobs, it will just fix server jobs (and batch jobs that change the current user).