IBM i CL basics
How IBM i Control Language commands are named, how to prompt them, and commands for jobs, spool files and messages.
CL (Control Language) is the IBM i command language. You can type a command on any IBM i command line, and the same commands are used in CL programs.
How commands are named
A command is a verb and an object: WRK (work with) + ACTJOB (active jobs), DSP (display) + MSG (messages), CRT (create) + LIB (library), CHG (change), DLT (delete), ADD, RMV, STR (start), END, SAV (save), RST (restore).
Prompting and help
- Type a command and press
F4to see its parameters with defaults. Fill them in and pressEnter. - Put
?before a command to prompt it. PressF1on a parameter for help. F9on the command line retrieves the commands you typed before.F11shows keywords in the prompt.- Special values begin with
*, such as*ALL,*LIBLand*CURLIB.
Everyday commands
GO MAIN the main menu (GO CMDxxx shows a command menu)
WRKACTJOB active jobs; option 5 to work with a job, 4 to end
WRKSBMJOB jobs you submitted
WRKSPLF your spooled output
WRKOUTQ queue output in a queue
DSPMSG your messages
DSPJOBLOG the job log of the current job
WRKSYSSTS system status and disk use
WRKSYSVAL system values
DSPLIBL your library list
ADDLIBLE lib add a library to the list
WRKLIB lib work with objects in a library
WRKOBJ obj work with objects by name
CALL PGM(lib/prog) run a program
STRSQL interactive SQL
SIGNOFF end the session
Names
Objects are qualified by library: MYLIB/MYFILE. *LIBL means "search the library list". See IBM i objects and libraries.
The command entry display
Run CALL QCMD for a Command Entry screen. It keeps the history of commands and their messages. F10 there includes detailed messages. If a menu has no command line at all, see IBM i screen has no command line: GO MAIN, CALL QCMD and LMTCPB.
Related
- IBM i objects and libraries
- 5250 function keys
- Signing on
- IBM host manuals
- Delete spooled files and clear an output queue on IBM i
- IBM i screen has no command line: GO MAIN, CALL QCMD and LMTCPB
- IBM i equivalent of sudo: SBMJOB USER, adopted authority and profile swaps
- IBM i Message Waiting light stays on: DSPMSG and delivery modes
- Automate IBM i green-screen tasks: job scheduler, SBMJOB, SSH and screen scripts
- IBM i shells: QSH, QP2TERM or SSH, and which to use
- End a stuck IBM i job: ENDJOB CNTRLD, IMMED and ENDJOBABN
- Run SQL on IBM i from a 5250 session: STRSQL, RUNSQL and RUNSQLSTM