Manta alt

YOUR IBM i TRAINING SOURCE

You must allow the browser to execute JavaScript programs if you want to view product information. If your browser is set up to execute JavaScript programs, the problem is that the product ID was incorrect. Use the menu bar above to find the desired product.

Overview

Audio

This course introduces the IBM i control language (CL) and control language programs.

The course begins by discussing how CL commands are used to communicate with the IBM i operating system. It describes the structure and syntax of CL commands and the command coding rules. The course then presents the concept of a CL program and lists the CL commands most frequently used in a CL program.

The course next covers CL variables. It shows how to declare and initialize a variable and describes the various ways in which variables can be manipulated. The course ends with a discussion of the built-in functions that can be used in a CL program to modify the contents of a variable.

Approximate Study Time: 2.5 hours

Objectives

After completing this course, you should be able to:

  • Identify the various components of a CL command
  • List the syntax rules for coding CL commands
  • Execute a CL program both in an interactive and a batch environment
  • List the advantages of packaging CL commands into a CL program
  • Code a simple CL source program
  • Identify the commands frequently used in a CL program
  • Continue a CL command on a new line in a CL program
  • Use comments to document a CL program
  • Name and describe the different types of CL variables
  • Declare and initialize variables in a CL program
  • Use the CHGVAR command to alter the contents of a variable
  • Code the RTVSYSVAL command required to accept a specified system value into a variable
  • Code the RTVJOBA command required to accept job information into a variable
  • Code the CVTDAT command to convert a date from one format to another
  • Define and use a defined variable
  • Define and use a pointer variable
  • Define and use a based variable
  • Use the %SWITCH function to test the settings of the job switches
  • Use the %BINARY function to interpret the contents of a character variable as a signed binary integer and store the corresponding decimal value in a decimal variable
  • Use the %BINARY function to convert a decimal value to its corresponding signed binary value and store the result in a character variable
  • Use the %SUBSTRING function to obtain a substring of a character variable
  • Use the %ADDRESS function to change or test the contents of a pointer variable
  • Use the %OFFSET function to change or test the contents of the offset value for a pointer variable

Topic Outline

Control Language Commands

Control Language Programs

Commands Commonly Used in a CL Program

Entering CL Source Statements

Introduction to CL Variables

CL Variables - The Rest of the Story

Built-In Functions

Audience

This course is intended for anyone who will be writing CL programs. This audience consists primarily of application programmers, but may include other people who use CL commands, such as system operators.

Prerequisites

This course assumes that you have a working knowledge of basic IBM i concepts and facilities. You can satisfy this prerequisite by successfully completing the courses in the following series:

The course also assumes you familiar with IBM i programming concepts and facilities. You can satisfy this prerequisite by successfully completing the courses in the following series: