Identifying a Parameter List in Classic RPGLE
The PLIST operation defines a parameter list in fixed‑format RPG. It works together with the PARM operation to describe the parameters a program receives when it is called. Although modern RPG uses prototypes and procedure interfaces, PLIST remains essential for understanding and maintaining legacy IBM i applications.
PLIST identifies a list of parameters that a program expects when it is called. Each parameter in the list is defined using a PARM operation. When another program uses CALL with matching PARM entries, the parameters are passed positionally into the PLIST.
What PLIST Does
- Defines a parameter list for a program
- Works with PARM to identify each parameter
- Supports named or unnamed lists
- Used only in fixed‑format RPG
- Required for programs that receive parameters through CALL
- Still important for reading and modernizing older code
Fixed‑Format
PARM Variable1
PARM Variable2
PARM Variable3
If the PLIST name is omitted, the list is considered unnamed.
Key Concepts
PLIST Defines the List - PLIST marks the start of a parameter list. Everything that follows, until the next operation code, belongs to that list.
PLIST Works Only with PARM - PLIST does not define parameters by itself. Each parameter must be declared using a PARM operation.
PLIST Can Be Named or Unnamed - A named PLIST can be reused in multiple CALL operations. An unnamed PLIST is typically used for the program entry parameters.
Example of unnamed entry list:
PLIST Is Positional: The order of PARM entries determines how parameters map from the caller to the callee. The first PARM receives the first parameter, the second receives the second, and so on.
PLIST Is for Programs, Not Procedures: PLIST belongs to the classic CALL interface. Modern RPG procedures use prototypes and parameter interfaces instead.
Example 1: Unnamed Entry Parameter List
PARM CustNumber
PARM CustName
PARM CustBalance
This program expects three parameters in this order.
Example 2: Named Parameter List
PARM OrderNumber
PARM OrderDate
PARM OrderAmount
A named PLIST can be referenced by multiple CALL operations in the same program.
Example 3: Caller and Callee Using PLIST
Caller program:
PARM MyOrder
PARM MyDate
PARM MyAmount
Called program:
The variables map positionally.
PARM OrderNumber
PARM OrderDate
PARM OrderAmount
When to Use PLIST
Use PLIST when:
Maintaining or reading legacy RPG programs
Working with fixed‑format CALL interfaces
Interfacing with older vendor applications
Migrating old code to modern prototypes
Avoid PLIST when:
Writing new RPG code
Building modular ILE applications
Using procedures or service programs
Working in free‑form RPG
PLIST defines a parameter list in classic RPG and works with PARM to identify each parameter. It is positional, fixed‑format, and tied to the CALL opcode. While modern RPG uses prototypes and procedure interfaces, understanding PLIST is essential for maintaining and modernizing legacy IBM i applications.
