Control Language Programming for IBM i - Softcover

Buck, Jim; Meyers, Bryan; Riehl, Dan

 
9781583473580: Control Language Programming for IBM i

Inhaltsangabe

Covering the basics of Control Language (CL) programming as well as the latest CL features&;including new structured-programming capabilities, file-processing enhancements, and the Integrated Language Environment&;this resource is geared towards students learning CL. The book guides readers towards a professional grasp of CL techniques, introducing complex processes and concepts through review questions, hands-on exercises, and programming assignments that reinforce each chapter&;s contents. In addition to 25 chapters that cover CL from start to finish, a comprehensive appendix with condensed references to the most commonly used CL commands is also included along with two additional appendixes that cover the essentials of programming tools and debugging.

Die Inhaltsangabe kann sich auf eine andere Ausgabe dieses Titels beziehen.

Über die Autorinnen und Autoren

Jim Buck is a programmer with more than 25 years of experience, an analyst instructor at Gateway Technical College, and the president of the Wisconsin Midrange Computer Professional Association. He is the coauthor of Mastering IBM i and the recipient of the 2007 IBM System i Innovation-Education Excellence Award. He lives in Kenosha, Wisconsin. Bryan Meyers is the author of numerous books, including Desktop Guide to CL Programming, RPG IV Jump Start, and VisualAge for RPG. He lives in Billings, Montana. Dan Riehl is the president of the 400 School and the IT Security and Compliance Group, LLC. He is a writer and technical editor for System iNEWS and the author of Control Language Programming for the AS/400. He lives in Chesterfield, Missouri.


Jim Buck is a programmer with more than 25 years of experience, an analyst instructor at Gateway Technical College, and the president of the Wisconsin Midrange Computer Professional Association. He is the coauthor of Mastering IBM i and the recipient of the 2007 IBM System i Innovation-Education Excellence Award. He lives in Kenosha, Wisconsin. Bryan Meyers is the author of numerous books, including Desktop Guide to CL Programming, RPG IV Jump Start, and VisualAge for RPG. He lives in Billings, Montana. Dan Riehl is the president of the 400 School and the IT Security and Compliance Group, LLC. He is a writer and technical editor for System iNEWS and the author of Control Language Programming for the AS/400. He lives in Chesterfield, Missouri.

Auszug. © Genehmigter Nachdruck. Alle Rechte vorbehalten.

Control Language Programming for IBM i

By Jim Buck, Bryan Meyers, Dan Riehl

MC Press

Copyright © 2008 Jim Buck, Bryan Meyers, and Dan Riehl
All rights reserved.
ISBN: 978-1-58347-358-0

CHAPTER 1

What Is CL?

* * *

Chapter Overview

This chapter examines the unique role of the IBM i operating system's Control Language (CL) in relation to other computer languages and describes CL's strengths and weaknesses. Emphasis is placed on the use of CL to control workflow and to define job streams to the System i computer. You will become familiar with the contrast between CL and typical high-level languages (HLLs), such as Cobol and RPG. The chapter also contains a brief discussion of compiled and interpreted CL, along with an explanation of the execution environment restrictions in effect when you use CL commands.


What CL Is

Control Language (CL) is a set of commands that you use to control operations and to request system-related functions on the IBM System i computer. IBM provides CL as an integrated part of the IBM i operating system (formerly known as i5/OS, and before that as OS/400), not as a separate product.

As a means of controlling workflow, CL serves purposes comparable to Job Control Language (JCL) on mainframe computers. CL, however, provides much more functionality than JCL. In some respects, CL is similar to the PC-DOS, Windows, or Linux commands you may use on a PC. Operations such as copying files, redirecting output, and making directories in those operating systems have direct CL counterparts.

CL originated on the IBM System/38 computer in the late 1970s and continued as the principal system-control language when IBM introduced the AS/400 in 1988. The AS/400 version of CL provided many enhancements over the S/38 version, including new commands and other added functionality. As the AS/400 and its OS/400 operating system evolved into the System i and its i5/OS, now IBM i, operating system, the system retained CL as its system-control language, making the necessary enhancements and changes to support new features and capabilities. Because of similarities among the various versions of CL, many S/38 and AS/400 CL commands and programs can be used on the System i, and vice versa.

A single CL statement is called a command. A CL command is the primary means of interacting with the System i. Nearly everything the computer does is requested by a command. There are commands to create and delete objects, commands to start programs, a command to power down the system, and even a command to create a command.

You can think of a command as an instruction to the computer to perform some function. For example, the DLTF (Delete File) command instructs the System i to delete a file. This command would be comparable to the DEL command, which is a part of DOS on personal computers. Most CL commands are supplied by IBM as part of the operating system, but you also can create your own commands, customized to your own installation's particular needs.

CL, as shipped by IBM, consists of thousands of commands but still maintains a useful consistency that makes the language easy to learn and to understand. You can use most CL commands in at least two ways: by typing them individually onto a command line and by grouping them together into a CL program. CL programs typically consist of multiple CL commands that define procedures or operations on the computer. By combining multiple commands within a CL program, you can automate most System i operations.

You should write CL programs to perform repetitive processing, thereby reducing errors and operator/user intervention. CL also is a natural choice for many utility programs that control or monitor system-related activities on the System i. Here are a few of the many functions CL can perform:

• Start jobs by calling programs or by submitting jobs for batch processing

• Control the sequence of processing within a program and among different programs

• Check for the existence of objects in the system and check for security authorizations to objects

• Create and manage system objects (e.g., files, programs, commands)

• Handle error conditions caused by commands or programs

• Control the operation of an application by establishing the values of variables used in the application, such as date, time, and other external information

• Control communications

• Send messages between programs and users or between programs and other programs

• Manage work on the system

• Create the environment in which a job will execute, controlling attributes such as which objects the job will use, what its execution priority will be, and how it will respond to unexpected errors

• Manipulate variable information, byte strings, and date formats

• Change the configuration of your server and define the devices attached to it


What CL Is Not

Although CL is very rich in function, it is not, in the classical sense of the term, considered to be a high-level language (HLL). You would not, for example, write a payroll application using CL exclusively. For such application programming on the System i, you would use a combination of CL and an HLL such as RPG or Cobol. You would use CL to implement the system-related procedures and functions of the application, and you would use the HLL to perform operations such as screen handling, file updates, and complex business logic. CL is used to manipulate and control an application's execution environment, generally as a "front end" to the HLL application programs.

Why wouldn't you use CL exclusively to create a typical business application? Because many functions perform better or are easier to write using an HLL, and CL just cannot do some computer operations. For example, CL programs can't add or update records in a database file, and CL has very limited printing capabilities. CL programs do not support the use of subfiles within application displays, nor do they support individual fields in program-described files. Database manipulation with CL is limited to reading files, and only a small number of files can be opened for I/O operations in a CL program. These missing pieces in CL make it unsuitable for developing a complete business application.


Controlling Workflow with CL

CL programs control the workflow of an application by letting you create job streams, which consist of CL commands to be executed in order. Within a CL program, you can alter the order of execution by testing various conditions that may exist during the execution of a job. You can monitor for errors that might occur while running a job and perform corrective actions or abort the job. You can pass values, or parameters, to and from CL programs to make them more flexible and to permit or restrict the execution of blocks of program code.

A CL program can incorporate conditional logic and special functions that are not available when you enter individual commands on a command line. You can also test and debug a CL program, just like any HLL program.

CL programs, unlike JCL, are implemented as compiled program objects rather than interpreted job streams. A CL program is a permanent object on the System i, created by compiling a group of CL commands.


CL Execution Environment and Restrictions

As you've learned, you can enter individual CL commands into the system interactively on a command line or include them in a CL program. You can submit individual...

„Über diesen Titel“ kann sich auf eine andere Ausgabe dieses Titels beziehen.

Weitere beliebte Ausgaben desselben Titels

9781583040959: Control Language Programming for IBM

Vorgestellte Ausgabe

ISBN 10:  1583040951 ISBN 13:  9781583040959
Verlag: 29th Street Pr, 2008
Softcover