By default, the iSeries always uses QUSER as the security profile, even when a user logs in with their own user ID and password. This is a limitation in the way IBM wrote the iSeries DDM database server for TCP/IP. However, you may need DDA/400 to access files with a user profile other than QUSER.
 
RJS Software has a CL command called CHGLOGIN that allows a user to change to a different iSeries user profile after starting a DDA/400 session from their PC programs. 
 
To change the iSeries user profile:
  1. Give all iSeries users access to the QSYGETPH program in QSYS:

    GRTOBJAUT OBJ(QSYS/QSYGETPH) OBJTYPE(*PGM) USER(*PUBLIC) AUT(*USE)

  2. Give all iSeries users access to the QWTSETP program in QSYS:

    GRTOBJAUT OBJ(QSYS/QWTSETP) OBJTYPE(*PGM) USER(*PUBLIC) AUT(*USE)

  3. Create the following CL program and command in QGPL or another iSeries library:

    CL command definition for CHGLOGIN command:

            CMD    PROMPT('Change Logged In User')
                        PARM      KWD(USER) TYPE(*CHAR) LEN(10) MIN(1)
        +
                                    PROMPT('User ID')
                        PARM      KWD(PASSWORD) TYPE(*CHAR) LEN(10) MIN(1)
        +
                                    PROMPT('Password')

    CL program definition for CHGLOGINC program:

           PGM        PARM(&USERID &PASSWORD)                        
                                                                     
           DCL        VAR(&USERID) TYPE(*CHAR) LEN(10)               
           DCL        VAR(&PASSWORD) TYPE(*CHAR) LEN(10)             
           DCL        VAR(&HANDLE) TYPE(*CHAR) LEN(12)               
                                                                     
           MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR))        
                                                                     
           /* GET USER PROFILE HANDLE    */                                       
           CALL       PGM(QSYGETPH) PARM(&USERID &PASSWORD &HANDLE)  
    
           /* SET USER PROFILE    */                                              
           CALL       PGM(QWTSETP) PARM(&HANDLE)                     
    NORMAL:                                                                
           RETURN                                                    
    ERROR:                                                                 
           SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Unable +   
                        to change user')                              
           ENDPGM    
  4. After logging in to a DDA/400 session, run the following CL command for each user to change their logged in user ID and password:

    QGPL/CHGLOGIN USER(USER) PASSWORD(PASSWORD)


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: December 10, 2016