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 rounds out your basic RPG coding skills. These skills, along with those you acquired by taking the first two courses in the Free-Form RPG Programming series, are the foundation on which later courses in the series will build.

The course begins by identifying the type of information that can be provided on a control (or header) specification and showing you how to code a CTL-OPT statement.

Next, the course considers built-in functions and the various operations they perform. It then describes the date and time processing capabilities built into the RPG IV language.

You will then see how to code a subroutine and how to call it from other routines. The course ends by describing how to detect error conditions, and how to obtain status information that indicates the cause of an error.

Approximate Study Time: 2.5 hours

Objectives

After completing this course, you should be able to:

  • Code a control specification
  • Identify the control specification keyword used to specify a given piece of information
  • Identify the RPG built-in function used to perform a specified operation
  • Code RPG statements that use built-in functions
  • Code an RPG program that manipulates date or time fields in the following ways:
    • Compares two date or time fields
    • Performs date or time arithmetic
    • Converts a date or time field from one format to another
    • Extracts a portion of a date, time, or timestamp field
    • Verifies that the contents of a date, time, or timestamp field are valid
  • Call a subroutine in an RPG program
  • Code a subroutine in an RPG program
  • Detect an error condition in an RPG program
  • Obtain information that indicates the cause of an error

Topic Outline

The Control (Header) Specification

RPG Built-In Functions

Working with Dates and Times

Using Subroutines

Program Error Processing

Audience

This course is intended for programmers new to the RPG programming language. It can also be taken by RPG III programmers who want to learn RPG IV and by RPG IV programmers who want to learn the free-form syntax.

Prerequisites

This course assumes that you are familiar with computer programming concepts. In order to satisfy this prerequisite, you should have some programming experience with another programming language.

This course also 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:

In addition, 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:

Finally, the course assumes that you have a understanding of basic free-form RPG programming concepts and file processing capabilities. You can satisfy this prerequisite by successfully completing the first two courses in this series: