AS400 Commands, Introduction

23 Most Common AS400 Commands

What is an AS400 command ? AS400 commands are CL (Control Language) commands. Most of them were written by IBM developers to...

Written by AS400i · 4 min read >

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.

Advertisements

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,
Eg:

  • 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

Etc…

Next letters will be a SUBJECT
Eg:

  • OBJ for Object
  • SPLF for Spool File
  • MSG for Message
  • PF for Physical File
  • LF for Logical File
  • PRT for Print

Etc…

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..

GO VERB AS400Command
GO VERB

The AS400 commands depend on user requirements. It can be broadly classified in the following categories

Work

WORK Commands
WORK Commands – (WRK*)

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.
e.g.:

  1. 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.
WRKOBJ Command
WORK OBJECT – (WRKOBJ)
  1. 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.
  1. 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.
  1. 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.

Create

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.
e.g.:

  1. 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.
CRTUSRPRF Command
CREATE USER PROFILE – (CRTUSRPRF)
  1. CRTOUTQ– It will create a new output queue if a user desires to process the job in a new output queue.
  1. CRTDUPOBJ – It will create a copy of an existing object in the different libraries with or without data as specified by the user.

Change

CHANGE Commands
CHANGE Commands – (CHG*)

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.
e.g.:

  1. CHGPF – It will change physical file attributes like adding or deleting a new field etc without the loss of existing data.
Advertisements
  1. CRGPRTF – It will change printer file attributes like line per inch, overflow line number, etc.
  1. CHGPRF – It will change the attributes of the current user profile like Message Queue, Output Queue, etc.

Display

DISPLAY Commands
DISPLAY Commands – (DSP*)

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.
e.g.:

  1. DSPNETA – It will display the current network attributes like Local Network Id, Server network ID/control point name.
  1. DSPSYSSTS – It will display the current system status like disk space storage used, no. of users signed in.
DISPLAY SYSTEM STATUS
DISPLAY SYSTEM STATUS – (DSPSYSSTS)
  1. DSPDTAARA – It will display the current value of the local/named data area as specified by the users.

Advertisements

Start

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.
e.g.:

  1. STRSQL – It will start an interactive SQL session where users can run their SQL commands.
STRSQL Command
START SQL – (STRSQL)
  1. STRDBG – It will allow users to debug a program line by line in case of any issues or program/data flow monitoring.
  1. STRRLU – It will allow users to start report layout utility to design the reports.

Edit

EDIT Commands
EDIT Commands – (EDT*)

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.
e.g.:

  1. EDTLIBL – It allows the user to change the current library list by adding a new library or removing the existing library.

Delete

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.
e.g.:

  1. DLTSPLF – It deletes a spool file or all spooled files for a user depending upon user selection.

Hold

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.
e.g.:

  1. HLDJOBQ – It will allow the users to hold the jobs in a job queue.

Advertisements

Override

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.
e.g.:

  1. OVRDBF – It will allow the users to override a database file for a member or set of data based on user input.

Others

  1. CALL – This command is used to call a program
CALL Command
CALL Command – (CALL)
  1. FTP – This allows users to start a TCP/IP File Transfer to transfer data to another server.
  1. 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.


Conclusion

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.

Physical File in AS400

Physical files in AS400

in Introduction
  ·   6 min read

IBM Rational Developer for i

in Introduction, User Interface
  ·   2 min read

CRTUSRPRF – Create User Profile

in AS400 Commands
  ·   16 min read

8 Replies to “23 Most Common AS400 Commands”

why dont you add your experience here