Admin Alert: Finding More Elusive OS/400 Commands
September 1, 2004 Joe Hertvik
In my last column, I discussed several ways to find and execute OS/400 green-screen commands, even when you don’t know the exact spelling of the command name. While I covered three different ways to find elusive OS/400 commands–using the Major Command Groups menu, the Select Command (SLTCMD) command, and the Verb Commands menu–several readers wrote in to tell me about a few other tricks that accomplish the same thing. Here’s what I learned.
Jerry Thornton and Ben T. Ray Jr. pointed out that you can get to the various command submenus listed on the Major Command Group, Subject, or Verb menus by going directly to the exact menu that lists a specific group of commands. You can do this by using this template to execute a Go to Menu (GO) command at a command line:
GO CMDxxxxxx
Where xxxxxx is a two to six character literal that refers to either the major command group you’re looking for, the subject of the command, or the verb that the command uses (all commands that deal with OS/400 file functions containing the literal FILE, for example). So if you wanted to find all the major command group commands for OS/400 file functions, you can bring up a list of these commands by typing the following at the command line:
GO CMDFILE
And this displays the File Commands menu. Note that we created the menu name to go to by replacing the xxxxxx literal with the word FILE, creating the name of the File Commands menu, CMDFILE. This technique works for all 23 of the major command groups listed on the MCG, including the Save and Restore command menu (CMDSAVRST), the Print command menu (CMDPRT), and the Programming command menu (CMDPGM). So if you know the general command group you want to work with, it’s a simple matter to bring up all the commands for that group by using GO CMDxxxxxx this way. These command menu names are also listed on the right-hand side of each option on the Major Command Groups menu.
The second way to find a command by using GO CMDxxxxxx is to display and select a command by the subject it refers to, rather than the major group it belongs to. With this technique, if you wanted to find all the commands that deal with RPG processing (which are generally displayed under the Programming major group), you display and select the RPG commands menu by typing the GO command this way:
GO CMDRPG
Similarly, if you wanted to look at all the commands associated with subsystem descriptions (SBSD), you could find these commands by entering this GO command:
GO CMDSBSD
And this technique helps you find any of the 150-plus subject command menus that are listed under the main Subject Command menu. If you don’t want to figure out the subject command menu name yourself, all the CMDxxxxxx menu names are also listed on the right-hand side of each option on the Subject Commands menu (GO SUBJECT).
In addition to using GO to find major group and specific subject command menus, you can use it to find specific verb command menus. Verb commands are grouped together by the action that a command performs, rather than the general grouping the command belongs to (the major group) or the subject it acts upon. So if you wanted to find all the commands that delete OS/400 objects (DLT), you can enter the following GO command:
GO CMDDLT
If you’re looking for all the commands that add something to an object in OS/400, you would execute this GO command:
GO CMDADD
Using this GO CMDxxxxxx template, you can find half-remembered OS/400 commands by looking through the command’s major grouping menu (FILE, SEC, DB, etc.), its subject menu (RPG, CL, etc.), or the verb action menu (CHG, ADD, DLT, etc.). This is a fairly easy way to cut down on the number of options you would normally have to scroll through in the MCG, Verb Command, or Subject Command menus.
In addition to providing this helpful tip, readers Vern Hamberg and Mike Collins showed me another technique for using all the advantages of the Select Command (SLTCMD) command without even entering SLTCMD on a command line.
Using this technique, I discovered that IBM has opened up a shortcut to SLTCMD by allowing you to turn OS/400 command line entries into SLTCMD wildcard searches. In the last article, I said that you could look up and select from all OS/400 commands that work with documents by entering the following SLTCMD command:
SLTCMD CMD(WRKDOC*)
But as Mike and Vern showed me, you can also get to the SLTCMD selection screen for all WRKDOC commands by entering the following generic literal on the command line:
WRKDOC*
By doing this, OS/400 automatically feeds this WRKDOC* wild card into the SLTCMD command and displays the results. This results in a generic command entry scenario that you can take advantage of to display SLTCMD when your memory fails you or when you don’t want to expend the energy to look up the exact command. The only flaw in this scenario, which Vern pointed out, is that IBM does not allow you to place a leading wildcard * in front of your command literal. But I guess you can’t have everything.
If you still don’t know what literals to use as you’re searching for specific command names, you can always lookup Appendix D of the OS/400 V5R2 CL programming manual (SC41-5721). Appendix D lists all the abbreviations that are used in CL commands, including verbs, subjects, and major control groups. Armed with this information, as well as the techniques presented in this article and the previous article, you should be able to find any elusive OS/400 command when you need it.