Você está na página 1de 18

Command Parameters

Part 3

Presentation © Copyright 2008, Bryan Meyers, www.bmeyers.net


Command Parameters

• Parameters explicitly describe what a


command will do
– Or how to do it
• Parameters are identified by a keyword
– Parameter value follows keyword in parentheses
DSPPFM FILE(Myfile)

Command Keyword Value


Required and Optional
Parameters
• Most commands have several parameters
– Some have none (e.g., DO, ENDDO)
• Some parameters are required
• Many are optional
– CL provides default values
DSPPFM FILE(MyFile) MBR(*FIRST) FROMRCD(25)

Required Optional Default Non-default

DSPPFM FILE(MyFile) FROMRCD(25)


Required and Optional
Parameters
http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/index.jsp

Required

Default Optional
Keyword Notation

• Keyword is required
• Can specify keywords in any order
• Any parameter can use keyword notation
DSPPFM FILE(MyFile) MBR(*FIRST) FROMRCD(25)

DSPPFM FROMRCD(25) FILE(MyFile) MBR(*FIRST)

DSPPFM FILE(MyFile) FROMRCD(25)

DSPPFM FROMRCD(25) FILE(MyFile)


Keyword Notation
http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/index.jsp

Keyword
Positional Notation

• Many – but not all – parameters can use


positional notation
• Keyword not required
• Must code parameters in correct order
– Parameters are in predetermined order
– Order is defined within command
DSPPFM MyFile *FIRST
Positional Notation
http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/index.jsp

Positional

Requires
keyword
Using *N

• You can use the *N special value as a


placeholder to skip positional parameters
– Seldom used
CPYF Myfile Yourfile *N *N *REPLACE
Mixing Keyword and Positional
Notation
• You can mix keyword and positional notation
• Once you begin keyword notation you must
use it for all subsequent parameters
– Positional parameter cannot follow keyword
parameter
CPYF Myfile Yourfile MBROPT(*REPLACE)
Parameter Types
Parameter Type Allowable Value
Character Any character string
Decimal A decimal number, as in 5 or 3.14
Integer, A numeric integer value as in 1 or 500
Unsigned integer
Logical A logical value of 1 or 0, representing true or false
Name A character string whose first character is alphabetic (A –
Z), $, #, or @, and remaining characters are alphanumeric
(A – Z, 0 – 9), $, #, @, _ (underscore) or . (period) –
generally identifies a device or object name
Generic name A partial name followed by an (*) asterisk, as in P* or
PAY* – identifies a group of objects
Command string Any CL command
Hexadecimal A hexadecimal number using digits 0 – F
Date A character string denoting the date, as in 123112 or
12312012
Time A character string specifying a time of day, as in 123000
Parameter Types
http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/index.jsp

Parameter type
Special Parameter Values

• Begin with *
• Identify CL reserved words
DSPPFM FILE(MyFile) MBR(*FIRST) FROMRCD(25)

Special value
Qualified Values

• Used to specify value or name in several parts


• Uses slash (/) qualifier character between
parts DSPPFM FILE(MyLib/MyFile)

Qualifier 2 Qualifier 1

DSPPFM FILE(MyFile) Qualifier 2 uses default

Qualified value
Qualified Values

• Typically used to identify object name or job


DSPJOB JOB(012345/MyUser/MyJob)

Qualifier 3 Qualifier 2 Qualifier 1

Qualified value
Value Lists

• Lists support several values for one parameter


• List must be in parentheses
– Eliminates confusion with positional notation
RSTOBJ OBJ(Customers Invoices Payments) SAVLIB(MyLib) DEV(TAP01)

RSTOBJ (Customers Invoices Payments) MyLib TAP01

Value list
Complex Lists

• List within another list


– Rarely used
RSTOBJ OBJ(*ALL) +
SAVLIB(MyLib) +
DEV(TAP01) +
FILEMBR((Customers (Mbr01 Mbr02)) +
(Invoices (Mbr01 Mbr02)) +
(Payments (Mbr01 Mbr02))) +
MBROPT(*ALL)

Complex list
Mixed Lists

• Mixed list
– Parameters in list may be different types
– Rarely used
CHGJOB LOG(4 00 *SECLVL)

Mixed list

Você também pode gostar