Intro to the AS/400 - Fox Valley Technical College

Download Report

Transcript Intro to the AS/400 - Fox Valley Technical College

Intro to the AS/400
Chapter 4 - Control Language
Copyright 1999 by Janson Industries
1
Objectives





Demonstrate CL’s general capabilities
Explain how CL commands are
constructed
Introduce the major CL command
categories
Explain job descriptions, system
values and jobs
Explain printing and spooling
2
CL Commands
Three Parts of a Command
CHG
USR
PRF
Verb
Adjective
Object
3
CL Commands
Verb - identifies the action to be
performed
Object - identifies the result or “thing”
that will be acted on
Adjective - further defines the object
4
Groups of CL Commands

Two major ways to classify commands
 Verb
 Object
Common Verbs
CHG - Change
CPY - Copy
DLT - Delete
STR - Start
Common Objects
F - File
LIB - Library
OBJ - Object
SEU - SEU
5
CL Commands

So if you know what you want to do,
you can often “figure out” the
command by combining the
appropriate verb, adjective and object
 Delete
a file?
DLTF
 Copy
a library?
CPYLIB
 Start
PDM?
STRPDM
6
CL Commands


This does not mean you can combine
any verb, adjective and subject
Some combinations make no sense
 Start
a file?
 Delete
 Copy
PDM?
SEU?
STRF
DLTPDM
CPYSEU
7
CL Menus

Major - list of CL command groups

Verb - CL commands by Verb

Subject - CL commands by Object
8
Major
MAJOR
Major Command Groups
System:
Boise
Select one of the following:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
Select Command by Name
Verb Commands
Subject Commands
Object Management Commands
File Commands
Save and Restore Commands
Work Management Commands
Data Management Commands
Security Commands
Print Commands
Spooling Commands
System Control Commands
Program Commands
SLTCMD
VERB
SUBJECT
CMDOBJMGT
CMDFILE
CMDSAVRST
CMDWRKMGT
CMDDTAMGT
CMDSEC
CMDPRT
CMDSPL
CMDSYSCTL
CMDPGM
More...
Selection or command
===> ________________________________________________________________________
______________________________________________________________________________
F3=Exit
F4=Prompt
F9=Retrieve
F12=Cancel
F13=Information Assistant
F16=AS/400 Main menu
9
Verb
VERB
Verb Commands
Select one of the following:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
Add Commands
Allocate Commands
Answer Commands
Analyze Commands
Apply Commands
Ask Commands
Auditing Commands
Call Commands
Configuration Commands
Change Commands
Check Commands
Close Commands
Cleanup Commands
Clear Commands
CMDADD
CMDALC
CMDANS
CMDANZ
CMDAPY
CMDASK
CMDAUD
CMDCALL
CMDCFG
CMDCHG
CMDCHK
CMDCLO
CMDCLNUP
CMDCLR
More...
Selection or command
===> _________________________________________________________________________
______________________________________________________________________________
F3=Exit
F4=Prompt
F9=Retrieve
F12=Cancel
F16=Major menu
10
Subject
SUBJECT
Subject Commands
Select one of the following:
34. Association Commands
35. Attention Commands
36. Attribute Commands
CMDASN
CMDATN
CMDATR
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
CMDAUT
CMDAUTL
CMDBACK
CMDBAS
CMDBCH
CMDBCKUP
CMDBGU
CMDBKP
CMDBND
CMDBSC
More...
Authority Commands
Authorization List Commands
Back Commands
BASIC Commands
Batch Commands
Backup Commands
BGU Commands
Breakpoint Commands
Binding Commands
BSC Commands
Selection or command
===>_________________________________________________________________________
____________________________________________________________________________
F3=Exit
F4=Prompt
F9=Retrieve
F12=Cancel
F16=Major menu
11
CL Command Syntax

The general format for a CL Command is:
 COMMAND

Parameter Parameter ….
3 ways to specify CL command
parameters:
 With
keywords
 Positionally
 On
a prompt screen
12
CL Command Syntax

Keywords:
 COMMAND

Positionally:
 COMMAND

Keyword(Value) Keyword(Value)
Value Value
Prompt:
 Type
the CL Command
 Press F4
 Type the values in the data entry fields
13
CL Command Syntax

Keywords:
 CPYF

Positionally:
 CPYF

FROMFILE(BATCH) TOFILE(BACKUP)
BATCH BACKUP
Prompt:
Copy File (CPYF)
Type choices, press Enter.
From file . . . . . .
Library . . . . . .
To file . . . . . . .
Library . . . . . .
From member . . . . .
To member or label . .
Replace or add records
Create file . . . . .
Print format . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. > BATCH
.
*LIBL
. > BACKUP
.
*LIBL
.
*FIRST
.
*FIRST
.
*NONE
.
*NO
.
*CHAR
Name
Name, *LIBL, *CURLIB
Name, *PRINT
Name, *LIBL, *CURLIB
Name, generic*, *FIRST, *ALL
Name, *FIRST, *FROMMBR
*NONE, *ADD, *REPLACE...
*NO, *YES
14
*CHAR, *HEX
Prompt Screens






Initially show only basic parameters
Highlighted fields are required
parameters
F10 displays additional parameters
F9 displays all parameters
(except conditional parameters)
List parameters identified by “+ for
more values” text
- Online help
15
Prompt Screens
Copy File (CPYF)
Type choices, press Enter.
From file . . . . . .
Library . . . . . .
To file . . . . . . .
Library . . . . . .
From member . . . . .
To member or label . .
Replace or add records
Create file . . . . .
Print format . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
__________
*LIBL
__________
*LIBL
*FIRST
*FIRST
*NONE
*NO
*CHAR
Name
Name, *LIBL, *CURLIB
Name, *PRINT
Name, *LIBL, *CURLIB
Name, generic*, *FIRST, *ALL
Name, *FIRST, *FROMMBR
*NONE, *ADD, *REPLACE...
*NO, *YES
*CHAR, *HEX
Initial list of parameters
To see more parameters
F3=Exit
F4=Prompt
F5=Refresh
F13=How to use this display
F10=Additional parameters
F24=More keys
Bottom
F12=Cancel
16
Prompt Screens
Copy File (CPYF)
Type choices, press Enter.
From file . . . . . .
Library . . . . . .
To file . . . . . . .
Library . . . . . .
From member . . . . .
To member or label . .
Replace or add records
Create file . . . . .
Print format . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
__________
*LIBL
__________
*LIBL
*FIRST
*FIRST
*NONE
*NO
*CHAR
Name
Name, *LIBL, *CURLIB
Name, *PRINT
Name, *LIBL, *CURLIB
Name, generic*, *FIRST, *ALL
Name, *FIRST, *FROMMBR
*NONE, *ADD, *REPLACE...
*NO, *YES
*CHAR, *HEX
Additional Parameters
Which records to print . . . . .
*NONE
*NONE, *EXCLD, *COPIED...
+ for more values
List parameter
Record format of logical file .
*ONLY
Name, *ONLY, *ALL
ToNumber,
see all*START
parameters
Copy from record number . . . .
*START
More...
F9=All parameters
F11=Keywords
F14=Command string
F24=More keys
17
Executing CL Commands



Type at any command line or Prompt
Screen and press Enter
F9 scrolls through previous commands,
displaying each on the command line
CALL QCMD displays the “Command
Entry” screen
 longer
command line
 visible log of issued commands
 easier retrieval of previously issued
commands
18
QCMD
Command Entry
DALLAS
Request level:
2
Previous commands and messages:
> dsplibl
> strpmd
Command STRPMD in library *LIBL not found.
Error found on STRPMD command.
> dspmsg
Bottom
Type command, press Enter.
===> _____________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
__________________________________________________________________________________
F3=Exit
F4=Prompt
F9=Retrieve
F10=Include detailed messages
F11=Display full
F12=Cancel
F13=Information Assistant
F24=More keys
19
CL commands that Create

CRTLIB

CRTSRCPF

STRSEU (creates a member)

CRTPF (compiles a member)

CRTCLPGM (compiles a member)
20
User Defined PDM Options




Remember: PDM options execute CL
Commands
F16 displays the “Work with User-Defined
Options” screen
F6 to display the “Create User-Defined
Option” screen
The specified CL command can use:
 Hard
coded parameters
OR
 Substitution parameters - &N, &L, &O
21
Work with User-Defined Options
Work with User-Defined Options
File . . . . . . . :
Library . . . . :
QAUOOPT
QGPL
Type options, press Enter.
2=Change
3=Copy
Opt
_
_
_
_
_
_
_
_
_
Option
AP
C
CC
CD
CL
CM
CS
DM
EA
Member . . . . . . :
Position to . . . :
4=Delete
BOISE
QAUOOPT
5=Display
Command
ADDPRJLIBL PRJ(&ZP) GRP(&ZG) SCAN(&ZH) SCHPTH(&ZS)
CALL &O/&N
CHGCURLIB CURLIB(&L)
STRDFU OPTION(2)
CHGCURLIB CURLIB(&N)
STRSDA OPTION(2) SRCFILE(&L/&F) ??SRCMBR()
STRSDA OPTION(1) SRCFILE(&L/&F) ??SRCMBR()
DSPMSG
EDTOBJAUT OBJ(&L/&N) OBJTYPE(&T)
More...
Command
===> _________________________________________________________________________
F3=Exit
F4=Prompt
F5=Refresh
F6=Create
F9=Retrieve
F10=Command entry
F24=More keys Copy
22
Create User-Defined Option
Create User-Defined Option
Type option and command, press Enter.
Option
. . . . . . . . .
__
Option to create
Command . . . . . . . . .
______________________________________________
____________________________________________________________________________
____________________________________________________________________________
____________________________________
F3=Exit
F4=Prompt
F12=Cancel Work with User-Defined Options
23
Substitution parameters

Substitution parameters retrieve info
from the specified list item
 &N
- list item name
 &L - list item library

To see all the available substitution
parameters:
 On
the “Create User-Defined Option”
screen, move the cursor to the Command
prompt field
 Press F1
24
Printing

All output is written to a spool file

Spool files stored on output queues

Spool files wait on the queue until:


CPU
a printer is assigned to the queue
the printer is available to print
Spool file
Q
Printer
Spool file
Print
Writer
Spool file
25
Printing components

Spool File
 Simultaneous

Peripheral Operations On Line
Output Queue
 An
object with a type = *OUTQ
 CRTOUTQ

Printer Writer
 A system
program that moves spool files
from an output queue to a printer
 STRPRTWTR - assigns a printer to an
output queue
26
Controlling Output
Printer
File
Job
Job
Description
User
Profile
Work Station
Description
System
Value
27
Print control

Job info - built when job is started
(date, time, user id, default outq, etc.)

Job description - stored job info

User profile - stored info re: a user id


Work Station description - stored info
regarding a display device (location,
msgq, etc.)
System value - parameters that are
valid for the entire system (date, time,
date format, # of invalid sign on
attempts allowed, etc.)
28
When is the print decision made?




When a spool file is created the
system must decide where to print
If the print information comes from a
print file, the print file dictates where
If the print file doesn’t specify, then
the job info of the job creating the
spool file dictates
Where did the job info come from?
Answer: it depends
29
Job Information




When you sign on your sessions job
information comes from many
locations - mainly your user profile
Alternately, a job can be created with
the SBMJOB command
The SBMJOB command allows you to
specify many of the Job Information
parameters
And, of course, once a job is created
its Job Info can be changed
30
When is the print decision made?



If the SBMJOB command or the user
profile doesn’t specify where to print:
a job description can be specified
which does
If none of the above, then the
workstation description is used
If nothing specifies where, the system
default printer is used
31
Spool Files


When the print location is determined
it is added to the spool files attributes
And, of course, a spool files attributes
can be change for as long as the
spool file exists
32
Working with Spool Files

WRKOUTQ

WRKSPLF

CHGSPLFA

WRKWTR

GO PRINTER
33
Why is printing so complex?

All the objects involved in printing
provide:
 More
control over printing
 Optimize
 Make
system resources
printing easier (believe it or not)
34
Why is printing so complex?

For instance:
 Always
want output (e.g. payroll
checks) to go to a certain printer:
print file
 Want
your output to go to a certain
printer: user profile
 Want
a certain terminals output to
always go to a certain printer:
workstation description
 Want
to change where something is
going to be printed: CHGSPLFA
35
Library Lists

List of libraries the system uses to
search for objects

Each user id has their own library list

Current Library

DSPLIBL

EDTLIBL
36
Library Lists
Display Library List
System:
BOISE
Type options, press Enter.
5=Display objects in library
Opt
_
_
_
_
_
_
_
_
_
_
_
_
_
Library
QSYS
QSYS2
QHLPSYS
QUSRSYS
QPDA
QADM
GRADES
INTROSW
BATCH
MYLIBXX
YOURLIBXX
INVENTORY
QGPL
Type
SYS
SYS
SYS
SYS
PRD
PRD
CUR
USR
USR
USR
USR
USR
USR
Text
System Library
System Library for CPI's
System Library for Users
System Libraries
Product Libraries
Current Library
User Libraries
General Purpose Library
More...
F3=Exit
F12=Cancel
F17=Top
F18=Bottom Copy File (CPYF)
37
Messages

Several types of messages:
 Information
 Inquiry
 Break



SNDMSG, SNDBRKMSG
Messages are sent to message
queues
DSPMSG or WRKMSG
38
Message Queues



Objects with type = *MSGQ
User ids and Workstations have
associated message queues
Message handling is controlled by the
message queue’s:
 Severity
code filter
 Delivery method

CRTMSGQ, CHGMSGQ
39
System Messages



Programs and the Operating system
can send messages
Bottom of a screen is the system
message area
DSPJOBLOG - shows history of all
messages. Very useful for problem
diagnosis. (More on this later.)
40
Points to Remember





CL commands create and manipulate
system and programming objects.
Most CL commands require parameters
Printing is complex and includes objects,
such as output queues, spool files and
print writers.
Each user’s library list acts as a library
search list for the system.
The AS/400 allows users to send and
display messages.
41