ILERPG.com β€” IBM i Β· ILE RPG Β· AS400 Mastery

This lesson is locked

A short preview is available. Purchase once for lifetime access.

Beginner Β· 9:00

File I/O: READ, WRITE, UPDATE, DELETE, and CHAIN

When a program declares a database file with DCL-F, the file's record format becomes a set of fields the program reads into and writes from β€” in effect, a data structure the system fills. This lesson covers the five operations that move records across that boundary: READ, CHAIN, WRITE, UPDATE,…

What you'll be able to do

  1. 1Declare a database file in free-format RPG with DCL-F, and explain how its record format becomes a structure the program reads from and writes to.
  2. 2Use READ in a loop to retrieve records sequentially, and use %EOF to detect end of file.
  3. 3Use CHAIN to retrieve a record by key, and use %FOUND to determine whether it exists.
  4. 4Use WRITE to add a new record, and explain what must be true about the record's fields beforehand.
  5. 5Use UPDATE and DELETE correctly against a retrieved record, and explain why each depends on that retrieval.

Create your account

Takes a few seconds β€” you'll be right back here after.

Sign in

Welcome back β€” you'll be right back here after.

Forgot your password?