Beruflich Dokumente
Kultur Dokumente
StarterKitfortheIBMiSeries&AS/400
Page 2 / 7
Reprintedforibm\gnaneshwar@in.ibm.com,IBM
29thStreetPress,GaryGuthrieandWayneMadden(c)2001,CopyingProhibited
StarterKitfortheIBMiSeries&AS/400
On any command line, press F4 (Prompt). OS/400 will present you with a menu of the major command groups. You can
choose menu options to find and select the command you need.
On any command line, type Go Cmdxxx, filling in the xxx with either a verb or an object for example, Go CmdPTF
for PTF-related commands or Go CmdWrk for "work with" commands. OS/400 will present you with a list of those
commands.
Type a generic name directly on the command line (e.g., Wrk*, Str*, CrtDev*) and press Enter. OS/400 will present you
with a list of commands that start with the same letters you specified before the asterisk.
Type a command on the command line, and press Fl (Help). OS/400 offers online help for all system commands.
NoteYou can also execute the SltCmd (Select Command) command to find commands using a generic name (e.g., Str*,
Wrk*). We don't recommend using this command, though; it's too easy to accidentally type D instead of S as the
first character in the command that's right, DltCmd Wrk*! Oops!!
Page 3 / 7
Reprintedforibm\gnaneshwar@in.ibm.com,IBM
29thStreetPress,GaryGuthrieandWayneMadden(c)2001,CopyingProhibited
StarterKitfortheIBMiSeries&AS/400
Keeping these guidelines in mind, let's practice a few commands. First, consider the DspObjD (Display Object Description)
command. Type DspObjD and press F4 to prompt the command. In the resulting screen (Figure 32.3), the line next to
"Object" will be in bold, indicating that parameter Object is a required parameter.
Page 4 / 7
Reprintedforibm\gnaneshwar@in.ibm.com,IBM
29thStreetPress,GaryGuthrieandWayneMadden(c)2001,CopyingProhibited
StarterKitfortheIBMiSeries&AS/400
or
DspObjD QGPL *Lib
Either command meets the syntax requirements. Keywords aren't needed because all the parameters used are positional
and the order of the values is correct. Suppose you type
DspObjD QGPL *Lib *Full
Will this work? Sure. In this example, you've entered, in the correct order, values for the two required parameters and a
value (*Full) for the optional, positional parameter (Detail).
What if you want to direct the output to the printer and you type
DspObjD QGPL *Lib *Full *Print
Will this work? No! You have to use the keyword (Output) in addition to the value (*Print), because Output is beyond the
positional coding limit.
Let's say you skip *Full and just enter
DspObjD QGPL *Lib Output(*Print)
Because you haven't specified a value for the positional parameter Detail, you'll get the description specified by the default
value (*Basic).
Most of the time, you'll probably prompt commands, but learning how to enter a few frequently used commands with
minimal keystrokes can save you time. For example, which would be faster: to prompt the WrkOutQ (Work with Output
Page 5 / 7
Reprintedforibm\gnaneshwar@in.ibm.com,IBM
29thStreetPress,GaryGuthrieandWayneMadden(c)2001,CopyingProhibited
StarterKitfortheIBMiSeries&AS/400
Should you prompt the WrkJobQ (Work with Job Queue) command just to enter the job queue name, or should you simply
enter
WrkJobQ JobQName
In both cases, you'll save yourself a step (or more) by simply entering the entire command.
Customizing Commands
Taking our discussion one step further, let's explore how you might create friendlier versions of certain useful system
commands. Why would you want to? Well, some (translation: "many") IBM-supplied commands are long, requiring multiple
keystrokes. You might want to shorten the commands you use most often. For example, you could shorten the command
WrkSbmJob (Work with Submitted Jobs) to WSJ or Jobs. The command WrkOutQ could become WO, and the command
DspMsg (Display Messages) could become Msg. How can you accomplish this without renaming the actual IBM commands
or having to create your own command to execute the real system command? Easy! Just use the CrtDupObj (Create
Duplicate Object) command.
Before trying this command, first create a library to hold all your new customized versions of IBM-supplied commands.
CautionDon't place the new command in library QSys or any other system-supplied library. New releases of OS/400
replace these libraries, and your modified command will be lost when that happens. Give your new library a
name that describes the library's purpose (e.g., AltSys), and include (before QSys) the new library in the
system portion of the library list of those users who will use your modified commands.
When the destination library is ready, use the CrtDupObj command to copy the commands you want to customize into the
new library. CrtDupObj lets you duplicate individual objects, or you can duplicate objects generically (i.e., using an initial
character string common to a group of objects followed by an asterisk), all objects in a particular library, or multiple object
types.
To rename the WrkOutQ command, you could enter
CrtDupObj WrkOutQ QSys *Cmd ALtSys WO
In this example, WrkOutQ, QSys, and *Cmd are values for required parameters that specify the object, the originating
library, and the object type, respectively. If you prompt for the parameters, enter
CrtDupObj Obj(WrkOutQ)
FromLib(QSys)
ObjType(*Cmd)
ToLib(AltSys)
NewObj(WO)
+
+
+
+
Either of these commands places the new command (WO) into library AltSys.
When you duplicate an object, all the object's attributes are duplicated. This means that the command processing program
for WO is the same as for WrkOutQ, so the new command functions just the same as the IBM-supplied command.
Changing Default Values
The final touch for tailoring commands is to modify certain parameter default values when you know you'll normally use
different standard values for those parameters. You may want to change default values for the CrtXxx (Create) commands
especially. For example, for every physical file created, you may want to specify the Size (Member size) parameter as
(1000 1000 999). Or you may want the WaitRcd (Maximum record wait time) parameter to contain the value 30 rather than
the IBM-supplied default value of 60. You can change these defaults using one of two methods.
The first method requires that everyone who uses a command remember to specify the desired values instead of the
defaults for certain parameters. Although you can place such requirements in a data processing handbook or a standards
guide, this method relies on your staff to either remember the substitute values or look up the values each time they need
to key them in.
The other method for changing the default values of IBM-supplied commands is to use the ChgCmdDft (Change Command
Default) command. ChgCmdDft simply changes the default values that will be used when the command is processed. For
Page 6 / 7
Reprintedforibm\gnaneshwar@in.ibm.com,IBM
29thStreetPress,GaryGuthrieandWayneMadden(c)2001,CopyingProhibited
StarterKitfortheIBMiSeries&AS/400
instance, to make the changes mentioned above for the CrtPF (Create Physical File) command, you'd type
ChgCmdDft Cmd(CrtPF)
+
NewDft('Size(1000 1000 999) WaitRcd(30)')
You could also use ChgCmdDft to enhance the WO command we created earlier. Suppose you usually use the WO
command to work with your own output queue. Why not change the default value of *All for the OutQ parameter to he the
name of your own output queue? Then, rather than having to type
WO YourOutQ
you could simply type WO (of course, this personalized command should exist only in your library list). If you want to work
with another output queue, you can still type in the queue name to override the default value. See? Commands can be fun!
To change system command parameter defaults using the ChgCmdDft command, you should duplicate the command into a
different library. Then change the command defaults and, if you have retained the CL command names rather than
renaming the commands, list the library before QSys on the system library list.
TipWhen you use the ChgCmdDft or CrtDupObj command to customize CL commands, you should create a CL source
program that performs those changes. Then whenever a new release of OS/400 is installed, you should run the CL
program, thus duplicating or modifying the new version of the system commands. The system commands on the
new release might have new parameters, different command processing programs, or new default values.
Using ChgCmdDft is an effective way to control standards. However, you should be cautious when using this command
because it affects all uses of the changed command. (For example, a vendor-supplied software package might be affected
by a change you make.) You might want to use a good documentation package to find all uses of specific commands and
evaluate the risk of changing certain default values.
You can change your user profile attribute UsrOpt (User options) to include the value *CLKwd if you want the CL keywords
to be displayed automatically when you prompt commands (rather than having to press F11 to see them). To change this
attribute, someone with the proper authority should enter the ChgUsrPrf (Change User Profile) command as follows:
ChgUsrPrf UserProfile UsrOpt(*CLKwd)
Page 7 / 7
Reprintedforibm\gnaneshwar@in.ibm.com,IBM
29thStreetPress,GaryGuthrieandWayneMadden(c)2001,CopyingProhibited