Problem solve Get help with specific problems with your technologies, process and projects.

Who are you really?

This is a short program that, when executed on an AS/400, will deliver your logon information to the console.

You Can View User Feedback To This Tip

Due to multiple AS/400's, user signon's, and workstations I use everyday to perform various tasks, this very simple command sends a message stating who and what system I am signed on. There is never a day I don't use it.

1. Create/Compile CLP source program 'DU':
DCL VAR(&USER) TYPE(*CHAR) LEN(10)                  
DCL VAR(&SYS) TYPE(*CHAR) LEN(8)                    
RTVUSRPRF  RTNUSRPRF(&USER)                                
 RTVNETA    SYSNAME(&SYS)                                              
SNDPGMMSG  MSG('You are logged on as' *BCAT &USER *TCAT +  
              ' on the' *BCAT &SYS *CAT 'system.')          

2. Create cmd source 'DU':
 CMD PROMPT('Display User Sign-On') 

3.  Create cmd 'DU':

4. I suggest creating the objects in library QGPL.  Change object owner/authority accordingly to your requirements.  At any command line, enter DU and press enter. 


  • In your tip of 7/25/01, you showed a simple command and CLP to show you your user name and what system you're on. You don't need any code to do this. Simply use DSPJOB on any command line, or System Request option 3. The current system name is on the right side of row 2, and the user name is in the center of row 3. — Dale Berta
  • Richard Cranston's tip (the DU command) does indeed display your logon information, and has the benefit of being customizable to show you ANY information you have access to... however, an alternative method that I use is to enter SysReq 7 (the sysreq shortcut to dspwsusr command). This screen shows me my logon ID, the system I'm on, how many interactive jobs are in the session, etc.. and it has the benefit of being on every machine (including clients) that I might find myself working on. — Rohn Blake
  • A simpler alternative to the DU command in "Who are you really?", this requires no code. SysReq 7, or DSPWSUSR — Peter Rye
  • Here are a couple OS/400 commands that provide this same information:
    DSPJOB - Easy to run with system-request-3 (if you can figure out where the system-request key is for your emulation session!)
    WRKUSRJOB - Especially helpful if you use system-request-1 (TFRSECJOB) to start a secondary session at your workstation. — Brian Johnson
  • Have you ever heard of the command DSPWSUSR? — W. Vandenheuvel
  • Dig Deeper on Performance

    Start the conversation

    Send me notifications when other members comment.

    Please create a username to comment.