What is an AS400 command ?
AS400 commands are CL (Control Language) commands. Most of them were written by IBM developers to perform system-level tasks like compiling programs, backing up data, changing system configurations, displaying system object details, or deleting them. Commands are not limited to systems-level concerns and can be drafted for user applications as well. Most common AS400 commands are obviously commands which use most of the times by programmers, system administrators and users.
What is a CL command ?
A CL command usually is made up of three-character words; up to 10 characters (usually three words) can be merged to form commands.
Therefore first 3 (or 4) letters of a command will be a VERB,
- WRK for Work
- DSP for Display
- CHG for Change
- CRT for Create
- STR for Start
- DLT for Delete
- EDT for Edit
- HLD for Hold
- OVR for Override
Next letters will be a SUBJECT
- OBJ for Object
- SPLF for Spool File
- MSG for Message
- PF for Physical File
- LF for Logical File
- PRT for Print
The command WRKSYSSTS, therefore, is translated as Work with the System Status. command CHGPWD means Change Password
Understanding this basic structure will help you in forming the commands yourself when you are not sure of the exact one. You can suffix a * (wildcard) on any commands and press enter to get the list of all of them. For eg: DSP* will give the list of all commands starting with DSP like DSPFD, DSPSYSSTS, DSPNETA, etc…
AS400 / CL commands can be entered on the command line or executed from within a program. When commands are entered via a program or menu, the user selects options that are displayed in a more friendly, English-type format. The program then translates the selected option into the appropriate CL command or commands.
In case you don’t know/remember command syntax, just type GO VERB on the command line and you will get the list of commands ordered by their functions like add, audit, configuration, compare, allocate, de-allocate, etc..
The AS400 commands depend on user requirements. It can be broadly classified in the following categories
These types of commands will always start with WRK. If you type WRK* and press enter, you will get a list of all commands starting with WRK.
- WRKOBJ – It will give the details of an object from a library. If *ALL is specified in the library, it will display the list of all objects with that name in the system.
- WRKSPLF – It will display the list of all spooled files created for the current user. Additionally, you can also specify additional selection criteria pressing F4 like spool files for a user or a job.
- WRKJOBQ – It will display the list of all the job queues in the system along with the number of jobs currently being processed in that job queue and status whether held or released and subsystem name.
- WRKACTJOB – It will display the list of all the jobs currently active in the system. It allows to work with performance and status information for those jobs.
These types of commands will always start with CRT. If you type CRT* and press enter, you will get a list of all commands starting with CRT.
- CRTUSRPRF – It will create a new user profile in the system with the details like user name, password, password expiry date, the initial menu option for the user, etc.
- CRTOUTQ– It will create a new output queue if a user desires to process the job in a new output queue.
- CRTDUPOBJ – It will create a copy of an existing object in the different libraries with or without data as specified by the user.
These types of commands will always start with CHG. If you type CHG* and press enter, you will get a list of all commands starting with CHG.
- CHGPF – It will change physical file attributes like adding or deleting a new field etc without the loss of existing data.
- CRGPRTF – It will change printer file attributes like line per inch, overflow line number, etc.
- CHGPRF – It will change the attributes of the current user profile like Message Queue, Output Queue, etc.
These types of commands will always start with DSP. If you type DSP* and press enter, you will get a list of all commands starting with DSP.
- DSPNETA – It will display the current network attributes like Local Network Id, Server network ID/control point name.
- DSPSYSSTS – It will display the current system status like disk space storage used, no. of users signed in.
- DSPDTAARA – It will display the current value of the local/named data area as specified by the users.
These types of commands will always start with STR. If you type STR* and press enter, you will get a list of all commands starting with STR.
- STRSQL – It will start an interactive SQL session where users can run their SQL commands.
- STRDBG – It will allow users to debug a program line by line in case of any issues or program/data flow monitoring.
- STRRLU – It will allow users to start report layout utility to design the reports.
These types of commands will always start with EDT. If you type EDT* and press enter, you will get a list of all commands starting with EDT.
- EDTLIBL – It allows the user to change the current library list by adding a new library or removing the existing library.
These types of commands will always start with DLT. If you type DLT* and press enter, you will get a list of all commands starting with DLT.
- DLTSPLF – It deletes a spool file or all spooled files for a user depending upon user selection.
These types of commands will always start with HLD. If you type HLD* and press enter, you will get a list of all commands starting with HLD.
- HLDJOBQ – It will allow the users to hold the jobs in a job queue.
These types of commands will always start with OVR. If you type OVR* and press enter, you will get a list of all commands starting with OVR.
- OVRDBF – It will allow the users to override a database file for a member or set of data based on user input.
- CALL – This command is used to call a program
- FTP – This allows users to start a TCP/IP File Transfer to transfer data to another server.
- RCLRSC – It will allow the users to reclaim the resources of the system.
Another point to note is the OS version, new commands get added with new OS release. In some rare cases, old commands get attribute changed, which means the actual command itself will change with OS versions.
Most useful/common AS400 commands are highly depend on the user category. as an example if you are an system administrator, you will use one set of commands in your day to day activities but at the same time a programmer will use another set of common commands.