AS400 Command Cheat Sheet (aka iSeries and IBMi)

The IBM AS/400 was the result of a long project at IBM to bring together their S/3, S/36, S/38 ranges onto a single common new platform. Over the years the platform evolved to be able to also run Unix, Linux, PHP and even via additional Intel processors Windows.  As the role of the platform has changed so has it’s name.  Originally coded named the Silver Lake Project, then AS/400, then iSeries and now IBMi. The Operating System is generally known as OS/400 and more recently IBM have referred to it as IBM i5/OS.

If you have a specific question about how to do something please post a comment and if I can I’ll answer your question and then add it to this list.

Here are a few facts to try and get you up to speed quickly:

  1. Don’t think of the IBM i (AS/400 or iSeries)  as a legacy platform. It actually one of the youngest Operating Systems on the market today.  Unix was started in the late 1960’s as a single user workstation operating system. Likewise Windows traces its roots back to DOS and VAX VMS which was reborn as Windows NT.  The OS/400 Operating System in contrast was designed on a blank sheet of paper in the mid-70’s as a future multi-user, object based operating system for smaller companies without big IT support departments.  It was one of the first fully 64bit platforms.  It’s technology independent software layer means that applications are dynamically regenerated if and when IBM ship new processors.  Over the years this has seen code auto update from 32bit, to 48bit and then full 64bit.  It’s internal addressing structure is 128bit already.
  2. We sometimes hear people say AS/400 is a legacy green screen system. Yes it does support a terminal interface in the same way that Unix and Apple Mac OS X and Windows do but the vast majority of people access applications running on the IBM iSeries today will be using a modern GUI environment and increasingly iSeries applications are delivered via a web browser interface. The Operating System comes with the Apache Web Server and IBM WebSphere pre-integrated and ready to go, so that users can connect to the OS Browser based admin portal.
  3. An AS/400 is to Unix what an Apple Mac is to Windows.  By this I mean that it ships with everything pre-integrated, for example the DB/2 database is integrated into the OS. The OS then uses DB/2 to store configuration information. Likewise as mentioned above Apache and WebSphere are pre-integrated.
  4. The AS/400 was the first Object based system.  Everything on the system is an object.  For example if you have a printer called PRT01 then you can use the DSPOBJ PRT01 command to display basic information about the printer, likewise if you have a user called FRANK then the DSPOBJ FRANK command will display basic information about FRANK.
  5. Because everything is an Object, security is inherited and enforced by the Operating System at Object level.
  6. OS/400 has GUI clients but was originally designed to be used from a text based terminal.  You can usually telnet in using a VT100 client but the system is designed to use the IBM 5250 client.
  7. The OS/400 text interface was probably one of the last text based Operating Systems to be created in the 90’s just as everything else was going GUI.  This is very much the state of the art text interface and worthy of study!
  8. If you don’t know any OS/400 commands then you can achieve a lot by simply typing GO MAIN and pressing enter.  This will take you to a user friendly main menu which will ask you what you want to do and then step you through doing it.
  9. F1 provides help anywhere.
  10. F4 provides context sensitive prompting and is much better than having to go through manpage on Unix.
  11. All the commands follow a logical naming convention eg <adjective><noun> for example WRKUSRPRF FRANK for Work with user profile Frank, DSPUSRPRF FRANK for display, DLTUSRPRF FRANK, PRTUSRPRF FRANK.
  12. For a complete list of commands try GO CMDWRK or GO CMDDSP or GO CMDPRT
  13. OS/400 supports virtualisation. One machine can be split into many LPARS (Logical Partitions) each being a virtual machine. Resources can be dynamically moved between LPARS for example memory,CPU’s etc. Each LPAR is a separate virtual machine (VM) and can run different versions of OS/400 and indeed other Operating Systems such as AIX and Linux.
  14. While you can split a system up using LPARS for most practical purposes where the workload is all OS/400 based the work is better managed through the creation of Sub Systems. This is object type *SUBSD or Sub-System Description. Once you have created a Sub System Description you can create job queues (CRTJOBQ) and then add these to the Sub System (ADDJOBQE) to get work done. You can also add work stations (terminals) to the Sub System (ADDWSE) to group users together. For example you might create a Sub System called TELESALES for your call centre where you want the operators to have the best possible response times. To this sub system you would add all the workstation ID’s in that department, add memory and processing priorities. You might then create another sub system called REPORTS where end of day management reports can be run. These can be lower priority.  Typically most AS400 systems have by default QBASE the base subsystem, QINTER the interactive subsystem and QBATCH the batch processing subsystem. If you end a sub-system (ENDSBS, e.g. ENDSBS QINTER *IMMED) the memory and processing is dynamically reassigned to the QBASE sub-system.
  15. OS/400 has a built in Queue object called a Data Queue. On other platforms you might have to install something like Apache MQ to achieve the same asynchronous process communications capability.

As above, if you have a specific question about how to do something on the AS/400 (iSeries) I’d love to hear from you.  Either e-mail me directly or better leave a comment below and I’ll get straight back to you.

You may also be interested in:

How do I find what version of J D Edwards (JDE) is installed?

How do I find what version of the AS/400 / OS/400 Operating System is installed?

 

 

  • Unique Post

Comments

  1. j perkins says:

    Do you know how to see what jobs or programs are running on an AS/400?

    • To see all the jobs / programs that are running on your AS/400 use the WRKACTJOB (Work Active Jobs) command. Once this is started you can use F5 to refresh the screen. You can even sort the display to see which jobs are using the most CPU. If you have any more questions about the AS/400 I’d be happy to answer them for you.

  2. Davida Hardy says:

    Is there a way to get a list of all installed software (this includes non-ibm software)?

    • David, If you have sufficient access rights then GO LICPGM and then take the option to display or work with installed licenses programs will show you what IBM software is installed. This will also show you some third party applications where the vendor has used the API packaging API’s. After that to get a good feel for what’s installed on an IBM iSeries I’d do a WRKLIBPDM (assuming PDM is installed) or just a WRKLIB (if not) and scan through all the libraries. That will give you a good view of what’s installed. There could be other applications written in Java, PHP, net.data etc that are installed in the IFS (Unix type file-system). You’ll need to either map a drive from your PC to the root directory of your iSeries (if you have rights) or use the WRKLNK ‘/’ command and navigate through the directories. It’s also worth interviewing a few users to see what applications they use, and then sanity check the lists you are getting against what you are hearing. Finally one iSeries (AS/400) box can run multiple Virtual Machines (VM’s) these days, in IBM terms these are known as LPARS (Logical Partitions). The other VM’s might not even has OS/400 installed on them, they could be Unix VM’s. Let me know if you have any more specific questions.

  3. Hi,

    This is a good post. Thanks for Posting this,

    I am very new to AS400 and searching for basic commands for my WebSphere Administrative work. Is there any document/book that you can refer me to?

    Appreciate your response. It will be very useful. Thanks!

  4. Is there a way I can avoid doing a total shut down of AS/400 when a user(s) connection is terminated and unable to get a display screen to log back on. I’m new to AS/400 but have been given the task to oversee and troubleshoot all problems pertaining AS/400.

    • It’s always worth trying the Disconnect User Job option, you’ll see this in WRKACTJOB, WRKJOB etc. This suspends the users session until they log back in again, typically for up to an hour. Depending on what state the program the user is running is in this may allow them to reconnect to the application without causing a runtime error.

  5. Curtis Burton says:

    Two questions:

    1) how to remove excessive items in the spool file?

    2) how to get the spool file to clean itself up on a weekly basis?

    mostly job logs

    • Hi Curtis, when you say excessive items in the spool file the answer will depend on what is generating each spool file. Many of the OS400 commands have options to control the level of output. If you can give me more details I might be able to help.

      There are lots of utilities available for cleaning up JOB LOG spool files from years ago but there is also built in support in the OS now. See the CHGCLNUP command (https://www.ibm.com/support/knowledgecenter/en/ssw_i5_54/cl/chgclnup.htm ). You might also have an issue on your system if you are seeing an excessive number of joblogs. This could mean a job is failing or just that a job description set-up wrongly to produce a job log even on a normal end. Let me know how you get on or if you have any follow-up questions.

Speak Your Mind

*