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

This course describes advanced RPG coding techniques involving the use of data areas, pointers, dynamic storage, null-capable fields, and output specifications.

The course begins by describing how an RPG program can access and modify a data area. Next, you will see how to define and use pointers in an RPG program. The course then shows how an RPG program can acquire, use, and free dynamic storage and how to process null-capable fields within an RPG program. The course ends by describing how to code the output specifications for a program-described printer file.

Approximate Study Time: 90 minutes

Objectives

After completing this course, you should be able to:

  • Access the contents of a data area
  • Change the contents of a data area
  • Define and use a basing pointer data item
  • Define and use a procedure pointer data item
  • Use the %ALLOC built-in function to acquire dynamic storage
  • Use the DEALLOC op code to free previously acquired dynamic storage
  • Use the %REALLOC built-in function to change the length of previously acquired dynamic storage
  • Use the ALWNULL control specification to control whether a program can read from and/or write to files containing null-capable fields
  • Identify a data item as being null capable
  • Use the %NULLIND built-in function to determine whether a null-capable field contains a null value
  • Pass a null-capable field and its null-byte map to a program or procedure
  • Identify and describe the F-spec keywords that are used with printer files
  • Use the EXCEPT op code to write records to a program-described printer file
  • Code the output specifications for a program-described printer file

Topic Outline

Using Data Areas

Using Pointers

Acquiring and Using Dynamic Storage

Processing Null-Capable Fields

Using Program-Described Printer Files

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 basic understanding of free-form RPG programming concepts. You can satisfy this prerequisite by successfully completing the first five courses in this series: