Control Language
Command usage:
An AS/400 command is an object designed to make it easy to call a program and/or get help on what the program does. It makes it easy because you can prompt any command with F4 to see what parameters the program accepts/requires (required parameters are highlighted). If you want to know what values a particular parameter allows you would move the cursor to that field and press F4 again. To see help on the parameter you would press F1. To instead get help for the command itself (and all of its parameters) you would press F1 then F2. To execute the command press Enter. To cancel execution press F3.
All parameters within each command have unique names. To see those names prompt the command and press F11. Many times when you prompt a command not all of the parameters are displayed on the first screen. If the word "More" appears in the lower right side of the screen press the page-down key to see the rest. Some commands are designed to only display a subset of parameters when they're first prompted. Additional parameters can be displayed with F10. In some cases the parameters that are displayed depend on what is entered in one or more parameters. In these cases you either have to enter the right values or you can see all parameters by pressing F9. Some parameters allow more than one value and to enter more than two you would put a plus-sign(+) on the last field and press Enter.
Commands of course don't have to be prompted. They can be executed right from the command line without ever having to press F4. IBM makes this easier because the most popular parameters for every command can be entered positionally without the parameter names. For example the DSPPGM command can be entered as DSPPGM PGM(MYPGM) or as DSPPGM MYPGM. (BTW: Commands are not case sensitive. I'm using upper case here to make it easier to discern.) To retrieve a command you've already executed press F9 on the command line. Each time F9 is pressed the command in the queue is retrieved.
You can create your own commands to call your programs and they will work exactly like the AS/400 variety. The Command Definition Language is described in the CL Programmer's Guide (http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/sm14/c4157215.pdf). (BTW: "CL" means "Control Language", and I assume it is reminiscent of "JCL".) Since you're in the business of selling software it's also a good idea to create help screens for your commands and their parameters. All help screens use Panel Group objects (*PNLGRP) and these can be created using the UIM Language described in the Application Display Programming manual (http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c4157150.pdf).
Finding the right command:
There are hundreds and hundreds of commands on the AS/400, but finding them isn't all that hard because of several designs of the system that make life easier for the average programmer. These labor saving designs are: Standardized TLA's, Command Grouping Menus, and Command Selection.
Standardized TLA's (Three Letter Acronyms):
IBM has standardized the Thee Letter Acronyms it uses to create command names. Verbs likes Change are always rendered as CHG, Display as DSP, Work as WRK, Create as CRT, etc. Subjects like Program are always PGM, Configuration is CFG, Module is MOD, Directory is DIR, etc. You can see every possible verb and subject used on the AS/400 in the VERB and SUBJECT menus, just enter GO VERB or GO SUBJECT.
Command Grouping Menus
The VERB and SUBJECT menus are part of what are called the Command Grouping Menus. For every three letter acronym there is a menus devoted to it that starts with the letters "CMD". So to see all CHG commands would execute the command GO CMDCHG. For program commands the menu would be CMDPGM.
There are other menus besides the Command Grouping Menus. The starting point for the menuing system can be accessed by press F4 on an empty command line.
Command Selection
If you only know part of a command or if you're using third party software whose commands don't conform to the IBM TLA standard then you would enter that part of the command you know, attach an asterisk (to make it generic), and press enter. The system will then display a list of commands in your library list that match the generic name you just types. You then page through the list looking for the command you need and then selecting it.
The system is using the SLTCMD command to perform this function. If you want to select all commands in a library then prompt this command and enter the special value *ALL.