Вы находитесь на странице: 1из 7

What is CL?

Part 1

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


What CL Is
Control Language
Set of over 2000 commands integrated into
IBM i operating system
Control operations
Comparable to JCL
But more functionality
Request system-related functions
Controls workflow
Creating, manipulating objects
Copying files
Redirecting output
What CL Is

Single CL statement is called a command


Primary means of system interaction
Most commands are supplied with IBM i
Can also create user-defined commands
Groups of CL commands can be packaged as
compiled program objects
Perform repetitive task streams
Reduce errors, operator intervention
What CL Is Not

Not a high level language (HLL)


Not used to create complex systems
But as a controlling front end
Limitations
Cannot add/update database records
Can only open five files at a time
No subfile support for display files
No communication file support
Controlling Workflow with CL

Create jobstreams
Monitor errors
Conditional logic
IF/THEN/ELSE
CL Execution Environments

Interactive
From a command line
Within a compiled program
Batch
As a command on SBMJOB command
Within a compiled program
As an interpreted jobstream using SBMDBJOB
Some commands only valid within a program
An Introductory Program
GREET: PGM
DCL &user *CHAR 10
DCL &date *CHAR 6
DCL &time *CHAR 6

RTVJOBA USER(&user)
RTVSYSVAL SYSVAL(QDATE) RTNVAR(&date)
RTVSYSVAL SYSVAL(QTIME) RTNVAR(&time)

SNDPGMSG MSG('Hello,' *BCAT &user +
*TCAT '. Login date-' +
*CAT &date +
*BCAT 'time-' +
*CAT &time) +
MSGTYPE(*COMP)

ENDPGM

Вам также может понравиться