No matter what your role, if you work on an AS/400 you have to type a lot of commands. WRKACTJOB, WRKUSRJOB, WRKSPLF,...
DSPPFM … the list is nearly endless. Most folks aren't perfect typists, and simple logic dictates that the longer the command name, the greater the possibility of mis-typing it. Also, clearly, the longer the command name, the longer it takes to type. This time is probably minimal for just a single command, but add up the times for hundreds of commands a day and you will have a substantial chunk of time.
Old technique still relevant
There is an old technique that has been around the AS/400 world a while, but for newcomers and old-timers alike, it is well-worth discussing again.
There are several variations of this technique, but many start with the Create Duplicate Object (CRTDUPOBJ) command. Let's take the very popular Work with Active Jobs (WRKACTJOB) command. Every AS/400 operator out there has probably typed this command so many times that his fingers can type the command name automatically. Still, fingers make mistakes. Why not abbreviate the command to something much simpler like WAJ?
This is easy enough to do with the Create Duplicate Object (CRTDUPOBJ) command. Simply enter the following command:
CRTDUPOBJ OBJ(WRKACTJOB) FROMLIB(QSYS) OBJTYPE(*CMD) TOLIB(USRSYS) NEWOBJ(WAJ)
After it has successfully executed, we can now just quickly type WAJ and hit Enter, and we will get the Work with Active Jobs screen.
Now note, the value of the TOLIB parameter on the Create Duplicate Object (CRTDUPOBJ) command above is "USRSYS." This is not a typo. I did not leave off the 'Q'. Avoid using QUSRSYS, since it can be overwritten during system installs and/or upgrades. You can, of course, place your new abbreviated commands in any library you like. I use USRSYS as a "safe" alternative to QUSRSYS.
What about other commands? The above technique works for any command. For example, you can create abbreviated versions of the other commands given as examples earlier. For example, WRKUSRJOB can become WUJ, WRKSPLF can be WSF, and DSPPFM simply DM.
Taking it to the next step
As previously mentioned, there are several variations of this technique. One is to combine it with the use of the Change Command Default (CHGCMDDFT) command.
An example illustrates this technique nicely. A common user desire is to see a list of spool files that he has created during the current sign-on session. In AS/400-speak, the user wants to work with his job's spool files. This is simple enough to do, but it requires a couple of steps. First, you must type the WRKJOB command. But you must also fill in the OPTION parameter with the value "*SPLF," as in WRKJOB OPTION(*SPLF).
To save time, it would be much easier if we had a command abbreviation such as WJS. Let's do it. First, duplicate the WRKJOB command as before:
CRTDUPOBJ OBJ(WRKJOB) FROMLIB(QSYS) OBJTYPE(*CMD) TOLIB(USRSYS) NEWOBJ(WJS)
Next, change the default of the OPTION parameter of our new WJS command. It needs to be changed from "*SELECT" to "*SPLF." To do this, use the Change Command Default (CHGCMDDFT) command, as in:
CHGCMDDFT CMD(WJS) NEWDFT('OPTION(*SPLF)')
Now, simply typing WJS will take you directly to the Work with Job Spooled Files screen. This command alone has personally saved me hours over all my AS/400 login time.
About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years experience programming for and managing AS/400-iSeries systems.
- Use CRTDUPOBJ to create a copy of the RUNQRY command
Do you often use the RUNQRY command to look at data in a file? Do you often have to use record selection when doing so? If the answer is yes, use CRTDUPOBJ to create a copy of the RUNQRY command.
- Create dynamic commands in a CL program using QCMDEXC
Most of us have used QCMDEXC to execute a CL program from an RPG program, but you can also use QCMDEXC to execute a command from a CL program. At first glance that sounds silly, but by using QCMDEXC you can dynamically execute commands that your CL program doesn't have to know about at compile time.
- Replace Performance Monitor commands in OS/400 V5R1
When IBM released OS/400 V5R1, it replaced OS/400's Performance Monitor feature with a new Collection Services function that is configured through the Management Central capability of iSeries Operations Navigator. That means many shops migrating to V5R1 must learn to put aside the old green-screen commands that start, stop, end, add and change performance collection data under the Performance Monitor and opt instead for the mostly graphical configuration capabilities that come with Collection Services. Unfortunately, there's a problem with this setup.