Who am I signed on as?

You Can View User Feedback To This Tip

If you work for a company that has multiple AS/400's and you use multiple user-ID's and workstations to perform various tasks, it is easy to lose track of whom you are signed on as on a particular workstation. I have created a simple command called 'WhoAmI' that displays:

1. The user-ID
2. The system (network) I am logged on to
3. Number of interactive jobs on a session and which user-ID is logged on at each of the interactive jobs
4. For 2 interactive jobs in a session, it will also indicate which interactive job is currently active.

1. Create and compile a CLP source program called WHOAMI
PGM
DSPWSUSR
ENDPGM

2. Create command source called WHOAMI
CMD PROMPT('Who am I?')

3. Create the command WHOAMI
CRTCMD CMD(WHOAMI) PGM(WHOAMI)

4. Create the object in QGPL and set the object authority appropriately to allow everyone to use the command. To use, type whoami on a command line and press ENTER.

USER FEEDBACK TO THIS TIP

  • There's an even easier way to know who you're signed on as and what system you're signed on to,and you don't have to code a thing.....System request 3 and look at the top of the screen.

    — D. Jorgensen

  • This was first published in July 2001

    Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.