AS400 Command Cheat Sheet (aka iSeries and IBM i)

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 its name.  Originally code-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 has referred to it as IBM i5/OS.

Despite the best efforts of Alison Butrill the AS/400 Product Manager at IBM to change the name of the system, doing a little keyword research on Google clearly shows that more people lookup AS/400 than IBMi on a monthly basis. Sadly they don’t find the IBM site when they try and look up this system.

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 is my AS400 Cheat Sheet to try and get you up to speed quickly:

AS/400 (OS400)
Command

Purpose
signoff
Log off
go <menu name>
eg go main
display a named menu
addlible
(Add Library List Entry)
On the AS/400 Libraries are essentially the same as databases on other platforms. The ADDLIBLE command adds the library to a list of libraries that will be searched for a given file or object. In this way, it’s a combination of the PATH and USE commands from other platforms.
dsplibl
(Display Library List)
Displays your current library list
wrkliblWork with you library list, allows you to interactively edit the list.
wrkactjob
(work with active jobs)
Similar to the top command in Linux or the task manager in windows. This command displays a list of all the jobs running on your AS/400. From here you can cancel jobs (option 4) and work with them to look at things like the files they have open (option 5)

This can be useful to see if any jobs have crashed and are awaiting operator assistance – see status MSGW (Message wait).

Jobs can sometimes be at status LCKW (Lock Wait), this means that the job is waiting to update a database record that another job (user) has open and locked. You can work with the locks to see who has the lock and ask them to come out of the screen they are in. The job will then resume automatically.
wrksplf
(Work with SPOOL files)
Work with (display) the SPOOL (ie printed output) from the jobs you have run.
Your job may be attached to an Output Queue which is attached to a printer. If not you will need to put an option 2 next to a report and press enter and then select an Output Queue.
wrkwtr
(work ‘print’ writer)
Basically, a print writer is like a print manager or printer driver. This command displays an interactive list of all the print writers on your system. These should relate to the attached printers. To actually print, it is necessary to start the writer – option 2. If the printer has an error, for example out of paper or a paper jam there will be a message waiting (MSGW). You’ll need to use option 7 to display the message. Fix the problem with the printer and then generally, option G will get it going again.
wrkjobq
(work job queue)
AS/400’s are used in very busy commercial environments where thousands of jobs have to be run every day. The system can’t do these all at once, so jobs are placed into a queue. Generally, one job runs from a queue at a time. This command will display a list of all the job queues on the system, from where you can select which one you want to work with. If you know the name of the job queue just enter WRKJOBQ QBATCH for example.
wrkjobscd
(work with the job scheduler)
This is the built-in job scheduler. This allows you to set up routine jobs to be run automatically. It’s very similar to crontab on Linux.
dspobj
(display object)
Display information about an object, eg DSPOBJ, press f4 to get the detailed prompt, enter QBATCH and object *JOBQ will display the details of the job queue object.
My most frequently used AS/400 commands

There are probably over a thousand AS/400 commands, but in normal operations, you will only need to use a handful and I’ve tried to give these above. If you want to know how to do something specific, please leave a message below and I’ll get back to you.

Is the IBMi (AS/400) a legacy system?

  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!

Some more commands to get you started on IBMi

  1. 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.
  2. F1 provides help anywhere.
  3. F4 provides context sensitive prompting and is much better than having to go through manpage on Unix.
  4. 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.
  5. For a complete list of commands try GO CMDWRK or GO CMDDSP or GO CMDPRT

Does IBMi support Kubernetes and Containers

  1. OS/400 supports virtualisation (and did so right from the day it launched). 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.
  2. 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.
  3. 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.
  4. Is an IBMi LPAR the same as a Container? No, each LPAR is a whole virtual machine, with a full Operating System.

AS/400 & IBMi Jobs

There is still a lot of demand for people with IBMi skills, but the market is nowhere near as big as it is for say Azure or AWS. This does mean if you get the opportunity to train in IBMi Power Systems and you are prepared to become an expert you could be very valuable, a big fish in a small pond.

There are however jobs in this area that are probably underpaid/undervalued and not for the fainthearted. I know of people who have been asked to modify 30-year-old RPG400 code which was machine-generated back in the day. But there’s lots of new code out there as well. J D Edwards started life on AS/400 and is still available. In recent years Oracle have rewritten a number of the older RPG400 programs into free format RPG4. This was driven by the need to exceed the limitations of the older language so that code could be updated to use the updated JDE ecosystem and tooling.

Is there support for 2FA or MFA on AS/400 5250 Signed Screen?

At the time of writing 2FA (two factor authentication) and MFA (Multi Factor Authentication) is not directly supported by OS/400. It would however be relatively easy to implement 2FA or MFA on IBM iSeries / AS/400. When a user signs on, the system looks at their User Profile to see if there is an initial, sign program specified. If there is the system will run it before anything else. A programmer could easily create a script to email or SMS the user with a random and time limited number which the user would need to enter to complete the login process.

This might help avoid end users sharing user id’s and passwords which seems to be a problem in some environments.

You should however NOT rely on the sign screen to protect your system. There are potentially a number of other ways to connect to resources on the system if you know a valid user id and password.

AS/400 Questions?

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?


Search


Recent Posts



Popular Posts




You May Also Like…

Find similar blogs in these categories: AS400,iSeries,i5 etc | IBM
11 Comments
  1. j perkins

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

    Reply
    • admin

      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.

      Reply
  2. Davida Hardy

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

    Reply
    • admin

      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.

      Reply
  3. Varun P

    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!

    Reply
    • Jeanette

      Has anyone found a list of basic commands for AS400?

      Reply
      • admin

        I’ll put a list of basic AS/400 (iSeries) commands up when I get a chance but in the meantime if you give me some feedback on what you want to do I’ll try and give you a specific answer.

        Reply
  4. Tax Admin

    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.

    Reply
    • admin

      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.

      Reply
  5. Curtis Burton

    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

    Reply
    • admin

      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.

      Reply
Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.