Contents
About This Reference ........xi
Who Should Use This Reference .......xi
Prerequisite and Related Information ......xii
How to Send Your Comments ........xii
What's New ..............xii
What's New in this Release .........xiii
THREAD(*CONCURRENT) .......xiii
Ability to define a main procedure which does
not use the RPG cycle .........xiii
Files defined in subprocedures.......xiii
Qualified record formats.........xiii
Files defined like other files........xiv
Files passed as parameters ........xiv
EXTDESC keyword and EXTFILE(*EXTDESC) xiv
EXTNAME to specify the library for the
externally-described data structure .....xiv
EXFMT allows a result data structure ....xiv
Larger limits for data structures, and character,
UCS-2 and graphic variables .......xiv
%ADDR(varying : *DATA) ........xv
Larger limit for DIM and OCCURS .....xv
Larger limits for character, UCS-2 and DBCS
literals ...............xv
TEMPLATE keyword for files and definitions . . xv
Relaxation of some UCS-2 rules ......xv
Eliminate unused variables from the compiled
object ...............xv
PCML can now be stored in the module....xv
Changes to this Guide Since V5R4 ......xvii
What’s New in V5R4? ..........xviii
What's New in V5R3? ..........xxii
What's New in V5R2? ..........xxvi
What's New in V5R1? ..........xxix
What's New in V4R4? ..........xxxiv
What's New in V4R2? .........xxxviii
What's New in V3R7? ..........xlii
What's New in V3R6/V3R2? ........xlvi
Part 1. RPG IV Concepts ......1
Chapter 1. Symbolic Names and
Reserved Words ...........3
Symbolic Names .............3
Array Names .............4
Conditional Compile Names ........4
Data Structure Names ..........4
EXCEPT Names ............4
Field Names .............4
KLIST Names .............4
Labels ...............4
Named Constants............4
PLIST Names .............5
Prototype Names ............5
Record Names .............5
Subroutine Names ...........5
Table Names .............5
RPG IV Words with Special Functions/Reserved
Words................5
User Date Special Words ..........8
Rules for User Date ...........8
PAGE, PAGE1-PAGE7 ...........9
Rules for PAGE, PAGE1-PAGE7 .......9
Chapter 2. Compiler Directives ....11
/FREE... /END-FREE (Positions 7-11)......11
/TITLE (Positions 7-12) ..........11
/EJECT (Positions 7-12) ..........11
/SPACE (Positions 7-12) ..........12
/COPY or /INCLUDE...........12
Results of the /COPY or /INCLUDE during
Compile ..............14
Nested /COPY or /INCLUDE .......14
Using /COPY, /INCLUDE in Source Files with
Embedded SQL ............14
Conditional Compilation Directives ......15
Defining Conditions ..........15
Predefined Conditions ..........16
Condition Expressions ..........17
Testing Conditions ...........17
The /EOF Directive ..........18
Handling of Directives by the RPG Preprocessor 20
Chapter 3. Procedures and the
Program Logic Cycle ........21
Subprocedure Definition ..........21
Procedure Interface Definition .......23
Return Values ............23
Scope of Definitions ..........24
Subprocedures and Subroutines ......25
Program Flow in RPG Modules: Cycle Versus Linear 26
Cycle Module ............27
Linear Module ............29
Module Initialization ..........30
RPG Cycle and other implicit Logic ......30
Program Cycle ............31
Subprocedure Calculations ........43
Implicit Opening of Files and Locking of Data
Areas...............46
Implicit Closing of Files and Unlocking of Data
Areas...............46
Chapter 4. RPG IV Indicators .....47
Indicators Defined on RPG IV Specifications . . . 47
Overflow Indicators ..........47
Record Identifying Indicators .......48
Control Level Indicators (L1-L9) ......49
Field Indicators ............57
Resulting Indicators ..........58
Indicators Not Defined on the RPG IV Specifications 60
External Indicators ...........60
© Copyright IBM Corp. 1994, 2008 iii
||
||