| Foreword |
|
xiii | |
| Preface |
|
xiv | |
| The Evolution of RPG |
|
xvi | |
|
|
|
1 | (34) |
|
Column-Oriented Program Specifications |
|
|
4 | (1) |
|
|
|
5 | (1) |
|
|
|
6 | (5) |
|
|
|
8 | (1) |
|
|
|
9 | (2) |
|
|
|
11 | (2) |
|
|
|
13 | (3) |
|
|
|
14 | (2) |
|
|
|
16 | (1) |
|
Workstation Function Key Response Indicators |
|
|
17 | (1) |
|
Function Key Attention Identification Byte |
|
|
18 | (1) |
|
|
|
19 | (2) |
|
|
|
21 | (1) |
|
Constants and Literal Values |
|
|
22 | (9) |
|
|
|
24 | (1) |
|
|
|
25 | (2) |
|
|
|
27 | (1) |
|
|
|
28 | (3) |
|
|
|
31 | (4) |
|
|
|
35 | (70) |
|
|
|
36 | (2) |
|
Header (Control) Specification |
|
|
38 | (1) |
|
Header (Control) Specification Summary |
|
|
39 | (3) |
|
File Description Specification |
|
|
42 | (6) |
|
File Description Specification Summary |
|
|
43 | (5) |
|
File Continuation Specification |
|
|
48 | (6) |
|
File Continuation Specification Summary |
|
|
49 | (5) |
|
Extension and Line Counter Specification |
|
|
54 | (3) |
|
Extension Specification Summary |
|
|
55 | (2) |
|
Line Counter Specification |
|
|
57 | (2) |
|
Line Counter Specification Summary |
|
|
58 | (1) |
|
|
|
59 | (18) |
|
Input Specification Summary |
|
|
61 | (1) |
|
|
|
61 | (3) |
|
Program Described File Field Descriptions |
|
|
64 | (2) |
|
Extermally Described files |
|
|
66 | (1) |
|
Extermally described Field Descriptions |
|
|
67 | (2) |
|
Data Structure Specification |
|
|
69 | (2) |
|
Data Structure Subfield Specification |
|
|
71 | (3) |
|
Special PSDS Data Structure Subfields |
|
|
74 | (1) |
|
Special INFDS Data Structure Subfields |
|
|
75 | (2) |
|
Named Constant Specification |
|
|
77 | (2) |
|
Calculation Specification |
|
|
79 | (4) |
|
Calculation Specification Summary |
|
|
80 | (3) |
|
|
|
83 | (12) |
|
Program Described Output File Control Entries |
|
|
84 | (3) |
|
Program Described Output File Field Description |
|
|
87 | (4) |
|
Externally Described Output File Control Entries |
|
|
91 | (3) |
|
Externally Described Output File Field Description |
|
|
94 | (1) |
|
|
|
95 | (2) |
|
|
|
95 | (1) |
|
|
|
96 | (1) |
|
|
|
97 | (1) |
|
Edit Words and Named Constants |
|
|
98 | (1) |
|
|
|
99 | (2) |
|
|
|
101 | (1) |
|
Date Edit Code Control Summary |
|
|
102 | (1) |
|
Table and Array Specification |
|
|
103 | (2) |
|
|
|
105 | (18) |
|
|
|
106 | (1) |
|
|
|
107 | (4) |
|
Detailed RPG Program Cycle Description |
|
|
111 | (6) |
|
Exception/Error Handling Routine Description |
|
|
117 | (6) |
|
Match Fields Routine Description |
|
|
119 | (1) |
|
Overflow Routine Description |
|
|
120 | (1) |
|
Look-Ahead Routine Description |
|
|
121 | (1) |
|
Program Controlled File Processing |
|
|
122 | (1) |
|
|
|
123 | (182) |
|
|
|
125 | (2) |
|
Unconditionable Operation Codes |
|
|
127 | (1) |
|
|
|
128 | (1) |
|
Operation Code Syntax Diagram Summary |
|
|
129 | (6) |
|
|
|
135 | (1) |
|
Operation Extender Cross Reference |
|
|
136 | (1) |
|
|
|
137 | (2) |
|
|
|
139 | (4) |
|
Standards and Conventions Used in this Chapter |
|
|
143 | (1) |
|
|
|
144 | (1) |
|
|
|
145 | (2) |
|
|
|
147 | (1) |
|
|
|
148 | (1) |
|
|
|
149 | (1) |
|
|
|
150 | (1) |
|
|
|
151 | (2) |
|
CABxx (Compare and Branch) |
|
|
153 | (1) |
|
CALL (Call Another Program) |
|
|
154 | (2) |
|
|
|
155 | (1) |
|
CASxx (Compare and Perform Subroutine) |
|
|
156 | (3) |
|
|
|
159 | (2) |
|
CHAIN (Random Record Access/Read) |
|
|
161 | (3) |
|
CHECK (Verify a Character String) |
|
|
164 | (3) |
|
CHEKR (Verify Right to Left) |
|
|
167 | (2) |
|
|
|
169 | (2) |
|
|
|
169 | (2) |
|
|
|
171 | (1) |
|
|
|
172 | (1) |
|
|
|
173 | (1) |
|
DEBUG (Print Debug Statement) |
|
|
174 | (1) |
|
DEFN (Define a Field or Data Area) |
|
|
175 | (3) |
|
DELET (Delete Data File Record) |
|
|
178 | (3) |
|
|
|
181 | (2) |
|
|
|
183 | (3) |
|
DOUxx (Begin Do Until-Loop) |
|
|
186 | (2) |
|
DOWxx (Begin Do While-Loop) |
|
|
188 | (2) |
|
DSPLY (Display Workstation Message) |
|
|
190 | (2) |
|
DUMP (Print Formatted Dump) |
|
|
192 | (1) |
|
|
|
193 | (1) |
|
ENDxx (End Do Group, Select Group, CASxx and IFxx) |
|
|
194 | (1) |
|
|
|
195 | (2) |
|
|
|
197 | (4) |
|
EXFMT (Write/Read a Workstation File Format) |
|
|
201 | (1) |
|
EXSR (Perform Subroutine) |
|
|
202 | (2) |
|
Subroutine Considerations |
|
|
203 | (1) |
|
|
|
204 | (1) |
|
Force (Force Input Priority) |
|
|
205 | (1) |
|
FREE (Deactivate an Active Program) |
|
|
206 | (1) |
|
|
|
207 | (1) |
|
IFxx (If Conditional Comparison) |
|
|
208 | (4) |
|
|
|
212 | (1) |
|
|
|
213 | (1) |
|
KFLD (Key List Key Field) |
|
|
214 | (1) |
|
|
|
215 | (1) |
|
|
|
216 | (1) |
|
LOKUP (Lookup Array or Table) |
|
|
217 | (2) |
|
MxxZO (Move Zone to Zone) |
|
|
219 | (1) |
|
MOVE (Copy Data Right-Adjusted) |
|
|
220 | (3) |
|
|
|
223 | (4) |
|
MOVEA with Figurative Constants |
|
|
226 | (1) |
|
MOVEL (Copy Data Left-Adjusted) |
|
|
227 | (3) |
|
|
|
230 | (2) |
|
MVR (Move Remainder of Division) |
|
|
232 | (1) |
|
NEXT (Force Next Input From a Specific Device File) |
|
|
233 | (2) |
|
OCUR (Set/Retrieve Data Structure Occurrence) |
|
|
235 | (3) |
|
|
|
238 | (2) |
|
|
|
240 | (1) |
|
OUT (Output an extemal data area) |
|
|
241 | (1) |
|
|
|
242 | (1) |
|
PARM (Parameter Declaration) |
|
|
243 | (4) |
|
PLIST (Parameter List Declaration) |
|
|
247 | (3) |
|
POST (Post Device Information) |
|
|
250 | (2) |
|
|
|
252 | (3) |
|
READC (Read Next Changed Workstation Record) |
|
|
255 | (1) |
|
READE (Read Next Record with an Equal Key) |
|
|
256 | (2) |
|
READP (Read Prior Record From a Data File) |
|
|
258 | (3) |
|
REDPE (Read Prior Record with an Equal Key) |
|
|
261 | (2) |
|
REL (Release an Acquired Device File) |
|
|
263 | (1) |
|
RESET (Reset Variable to it's Initial Value) |
|
|
264 | (3) |
|
|
|
265 | (2) |
|
RETRN (Return to Calling Program) |
|
|
267 | (1) |
|
|
|
268 | (1) |
|
SCAN (Scan String or Array) |
|
|
269 | (2) |
|
SELEC (Start In-Line CASE Group) |
|
|
271 | (2) |
|
Differences between SELEC/WHxx and IFxx/ELSE |
|
|
271 | (2) |
|
|
|
273 | (2) |
|
|
|
275 | (1) |
|
SETOF (Set Off an Indicator) |
|
|
276 | (1) |
|
SETON (Set On an Indicator) |
|
|
277 | (1) |
|
SHTDN (Test for Shut Down Request) |
|
|
278 | (1) |
|
|
|
279 | (1) |
|
|
|
280 | (1) |
|
|
|
281 | (2) |
|
SUBST (Substring then Move Left) |
|
|
283 | (2) |
|
|
|
285 | (1) |
|
|
|
286 | (2) |
|
TESTN (Test Character Field for Numeric Data) |
|
|
288 | (1) |
|
TESTZ (Test the Zone of a Field) |
|
|
289 | (1) |
|
TIME (Retrieve System Time and Date) |
|
|
290 | (1) |
|
UNLCK (Unlock Data Area/Release Record Lock) |
|
|
291 | (2) |
|
|
|
293 | (2) |
|
WHxx (In-Line CASE Selection/When True then Select) |
|
|
295 | (2) |
|
|
|
297 | (2) |
|
XFOOT (Cross Foot an Array) |
|
|
299 | (1) |
|
XLATE (Translate a Character String) |
|
|
300 | (3) |
|
|
|
303 | (1) |
|
Z-SUB (Zero and Subtract) |
|
|
304 | (1) |
|
Modern Operation Code Usage |
|
|
305 | (22) |
|
|
|
306 | (1) |
|
Indicator-Controlled Logic |
|
|
307 | (2) |
|
Indicator-less Controlled Logic |
|
|
309 | (2) |
|
|
|
311 | (8) |
|
DO Loops with Level-Break Processing |
|
|
311 | (1) |
|
Do While and Do Until Operations |
|
|
312 | (2) |
|
|
|
314 | (1) |
|
|
|
315 | (1) |
|
Ranges, Lists, and Select and Omit |
|
|
316 | (3) |
|
|
|
319 | (8) |
|
|
|
327 | (20) |
|
|
|
329 | (1) |
|
|
|
329 | (3) |
|
|
|
332 | (3) |
|
Structured Operation Codes |
|
|
335 | (1) |
|
|
|
335 | (1) |
|
The IF-THEN-ELSE Structure |
|
|
336 | (4) |
|
|
|
340 | (7) |
|
Successive CASE Operations |
|
|
342 | (2) |
|
Compare and Branch Operations |
|
|
344 | (3) |
|
|
|
347 | (36) |
|
Inter-module Communication |
|
|
350 | (1) |
|
|
|
351 | (10) |
|
|
|
361 | (6) |
|
|
|
367 | (6) |
|
|
|
370 | (1) |
|
Function Controlled Logic |
|
|
370 | (3) |
|
|
|
373 | (7) |
|
|
|
380 | (3) |
|
|
|
383 | (36) |
|
Full Procedural File Processing |
|
|
384 | (3) |
|
|
|
387 | (11) |
|
|
|
389 | (3) |
|
|
|
392 | (3) |
|
|
|
395 | (2) |
|
|
|
397 | (1) |
|
|
|
397 | (1) |
|
File Operation Code Effects |
|
|
398 | (5) |
|
|
|
403 | (3) |
|
Workstation Device File Processing |
|
|
406 | (1) |
|
CHAIN (Random File Access) |
|
|
407 | (1) |
|
OPEN and CLOSE (Open and Close a File) |
|
|
408 | (1) |
|
EXFMT (Write then Read Workstation Device) |
|
|
409 | (1) |
|
POST (Post Device Specific Information) |
|
|
410 | (1) |
|
READ (Read a Record from a File) |
|
|
411 | (1) |
|
READC (Read Next Changed Subfile Record) |
|
|
412 | (1) |
|
|
|
413 | (1) |
|
|
|
414 | (1) |
|
Interpreting the Cursor Position |
|
|
415 | (4) |
|
|
|
419 | (18) |
|
|
|
420 | (3) |
|
|
|
421 | (1) |
|
Relational Database Terminology |
|
|
421 | (2) |
|
|
|
423 | (5) |
|
|
|
424 | (1) |
|
|
|
425 | (3) |
|
|
|
428 | (6) |
|
|
|
428 | (1) |
|
|
|
429 | (1) |
|
|
|
430 | (1) |
|
|
|
431 | (3) |
|
RPG File OpCodes vs. SQL Statements |
|
|
434 | (3) |
|
|
|
437 | (18) |
|
File Information Data Structure |
|
|
438 | (7) |
|
|
|
438 | (2) |
|
File Information Data Structure |
|
|
440 | (4) |
|
Predefined INFDS Subfields |
|
|
444 | (1) |
|
Program Status Error Codes |
|
|
445 | (2) |
|
Program Status Data Structure |
|
|
447 | (3) |
|
Exception/Error Subroutine |
|
|
450 | (5) |
|
|
|
455 | (20) |
|
|
|
456 | (11) |
|
|
|
456 | (5) |
|
|
|
461 | (6) |
|
Multiple Occurrence Data Structures |
|
|
467 | (8) |
|
Example Application - Quarterly Sales Report |
|
|
467 | (8) |
|
|
|
475 | (18) |
|
|
|
476 | (3) |
|
|
|
479 | (7) |
|
Compiler Listing from DSPWRD |
|
|
486 | (7) |
| Appendix A |
|
493 | (4) |
|
IBM AS/400 RPG/400 RPGIII Compiler Command Parmaeters |
|
|
494 | (3) |
| Appendix B Decimal Data Errors and the AS/400 RPG Compiler |
|
497 | (1) |
|
|
|
498 | (1) |
|
|
|
498 | (1) |
|
Ignore Decimal Data Error |
|
|
499 | (1) |
|
|
|
500 | (1) |
|
|
|
501 | (1) |
|
Zoned Decimal Data Errors |
|
|
502 | (2) |
|
|
|
504 | (1) |
|
Packed Decimal Data Errors |
|
|
505 | (1) |
|
Conditions for Decimal Data Errors |
|
|
506 | (1) |
|
Decimal Data Error Upon Input Operation to a Database File |
|
|
506 | (2) |
|
Decimal Data Errors During Calculation Specifications |
|
|
508 | |