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 shows you how to control the flow of command execution within a program and how to pass control between programs and/or procedures.

The course first describes how to test conditions in a CL program and how to control the execution of commands based on the result of such a test. This discussion includes a description of the logic structures used in conditional processing and CL program excerpts that illustrate the use of conditional processing.

The course then describes how to modularize an application. You will see how to modularize an application using subroutines, procedures, and subprograms.

Approximate Study Time: 90 minutes

Objectives

After completing this course, you should be able to:

  • Code CL commands to implement an IF structure
  • Code CL commands to implement an IF/ELSE structure
  • Code CL commands to implement an execution loop
  • Code CL commands to implement a nested IF structure
  • Code the CL command to call a subroutine
  • Code a subroutine in a CL program
  • Code a CL subprogram or procedure to perform a specified function
  • Code a CL program that calls a subprogram or a procedure
  • Use parameters to communicate between programs

Topic Outline

Introduction to Conditional Processing

Coding an Execution Loop

Using Subroutines

Calling Programs and Procedures

Coding Subprograms and Called Procedures

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:

The course also assumes that you have a basic understanding of CL programming concepts and know how to declare and use variables in a CL program. You can satisfy these prerequisites by successfully completing the first course in this series: