P (pad result) operation extender, 193
packed decimal data, 13
decimal data errors and, 559, 564–566
PACKEVEN Definition specification keyword, 65
%PADDR, 117, 118, 123, 160–161
PAGE reserved field name, 28
parameter lists (PLIST), 9, 29, 187, 189, 326–328, 453–459
CALL and, 219, 326
CALLB and, 221, 326
named vs. unnamed, 326
PARM and, 326
SPECIAL device routine and, 326–328
syntax diagram for, 197
parameter passing, 452–460
by reference, 324, 454–455, 454
by value vs. by reference, 324
CALL and, 456–458
data structures passed as parameters in, 459–460
entry parameter lists in, 453
field addresses in, 456
memory locations in, 455–456, 455
named parameter lists in, 455–456
PARM and, 457–459
PLIST and, 453–459
prototyped call interface in, 455
read-only parameters in, 454
weak parameter module in, 455
parameters
expressions as, 111–113
expressions in, 110
parameters data area (PDA), DEFINE and, 244
parentheses
built-in functions and, 117
free-format syntax in, 540
PARM, 187, 189, 323–326, 481, 482, 483
by value vs. by reference parameter passing and, 324
CALL and, 219, 323–326
CALLB and, 323–326
MOVEL and, 324
parameter lists (PLIST) and, 323–326
*PARMS and, 324
pointers, 324
prototyped calls and, 457–459
syntax diagram for, 197
Z-ADD and, 324
%PARMS, 117–118, 123, 162, 324
partial key lists, 501
PASS file specification keyword, 49
*PDA, 30
period (.) edit word control code, 93
PERRCD keyword, 65, 98–100
personal computer (PC) workstations, 517–518
*PGM compiler option, 543, 544
PGMNAME File specification keyword, 49
physical files, 497, 498–503
key fields in, 500–503
partial key lists in, 501
product structure file in, 502–503
PL/I, xxii, 6, 37, 106, 409
*PLACE, 30
PLIST (See parameter lists)
PLIST keyword, 49, 453–459
plus sign (+) operator, 104
pointer data type, 13
position-oriented languages, 3
position-oriented RPG IV, 4, 6
positive values, decimal data errors and 562–566
POST, 187, 329–330, 496, 521
syntax diagram for, 197
workstation device file processing and, 518
power function (**), 105–106
PREFIX keyword, 50, 66
preprocessor directives, 31–34, 33
PRINT key, 22
printer files, 79, 82, 205
priority of operators, 105–106
procedure expressions, 103
procedure interface, prototyped calls and, 462–463
procedure specifications, 4, 8, 9, 37, 89–90
procedures and subprocedures, 10, 395, 400, 421–423, 431, 473–491
application program interfaces (APIs) and, 489–491
application-specific, 476
arguments in, 480
CALL, CALLB, and CALLP in, 395, 399–401, 477–478, 479–489, 490
calling, 476–478
CEEDOD (Retrieve Operational Descriptor) and, 490–491
choice constructs in, 450
/COPY and, 479
Create Program (CRTPGM) and, 476
Create RPG Module (CRTRPGMOD) and, 476
data areas in, 467–471, 467
data structures and prototyped procedures in, 464–466
definition for, 478–480
definition specification and, 52
function modules in, 450
general-purpose, 476
hierarchy of modules in, 423, 451, 451
identification of, 479
IMPORT and EXPORT in, 403–405, 404, 405
inline ILE, 588–589
interface for, 479, 489–491
local variables and, 423
logic control modules in, 450
mainline, 476, 483, 484
modular programming benefits of, 449–451
module storage of, 475–476, 475
*MODULE and, 475, 484
multiple source files using, 401
*NOMAIN keyword and, 475, 484, 485
OPDESC keyword and, 489–490
parameter passing in, 452–460
PLIST for parameter passing in, 453–459
program entry point (PEP) and, 483–489
prototyped calls in, 460–464
prototyped procedure keywords for, 481–483
prototypes for, 478, 479
repetition constructs in, 450
RPG cycle and, 475, 484, 486
sequence constructs in, 450
source file structure of, using mainline procedure, 476, 485–489
static vs. automatic storage in, 402–403
top-down programming and, 450
user entry procedure (UEP) and, 484
user-written functions and, 477
user-written, 475–476
PROCPTR Definition specification keyword, 66
product structure file, 502–503
program binding, 395
program described files
CHAIN and, 229–231
EXCEPT and, 269–272
file specifications for, 43–51
Input specifications and, 68–73
Output specifications and, 80–85
WRITE and, 384–385
program design, 428
program entry point (PEP), 483–489
program hierarchy chart, 451, 451
program logic cycle, 397
program names, 395
program organization, 393–405
activation groups in, 400
application source files in, 401
bound modules vs. independent programs in, 399–400
CALL and, 399–401
Create Bound Program (CRTBNDRPG) and, 396, 400
Create RPG Module (CRTRPGMOD) and, 396–397, 400
embedded subprocedures in, 400
flat file systems and, 396–397
IMPORT and EXPORT in, 403–405, 404, 405
Integrated File System (IFS) in, 395–396
machine readable or executable objects in, 399
mainline procedure in, 395, 397, 397
module definition in, 397–401
*MODULE in, 395
multiple source files with embedded/external subprocedures, 401
NOMAIN keyword in, 397
program binding in, 395
program logic cycle in, 397
program names in, 395
scope in, 397, 401–402, 402
single-source file RPG programs in, 400
source file member contents in, 397
source files and source file location in, 395–397
source program structures in, 400
static vs. automatic storage in, 402–403
subprocedures in, 395
variables in, local vs. global, 397–402, 402
program status codes, PARM and, 202–203
program status data structure (PSDS), 52, 56, 521, 590
program termination indicator, 17
program-to-program calls, 452–460, 452
prototype name definition statement, prototyped calls and, 463
prototyped call interface, 455
prototyped calls, 460–464
CALLP and, 461, 463, 464
named parameter lists and, 463
procedure interface definition statement in, 463
procedure interface in, 462–463
prototype name definition statement in, 463
prototyped procedures
data structures and, 464–466
keywords for, 466, 481–483
prototypes
CALLP and, 223–224, 223
Definition specification and, 52
procedures and subprocedures, 478, 479
prototyped procedure keywords for, 481–483
ZINCLUDE source code listing, 581–582
PRTCTL File specification keyword, 50
pseudocode, 6
*PSSR, 30, 202, 214
PWRDWNSYS (Power Down System), SHTDN and, 360