ÉÂÔ
Page
 ÉÂÔ
 Third Edition May 1999
 Contents
 With
SQL
 Chapter
Service Program
 Exception
Vi ILE
 Vii
Working with Files and Devices
 Files
RPG
 ILE
Appendixes
 Index
Copy
 Law
Does
Apply
Any
 Trademarks Or se Marks Others
Trademarks and Service
Programming Interface Information
Marks
Page
 Xiv ILE RPG for AS/400 Programmers Guide
 III
About This Guide
Guide
Who Should Use This
 Prerequisite and Related Information
How to Send Your Comments
 Risc
What New This
Release?
UCS-2
 INZ*USER
INZ*EXTDFT
 Element
 CCSID*GRAPH
 For AS/400
To this Guide
Changes
Since
 Xxii ILE RPG for AS/400 Programmers Guide
 Program creation strategies
ILE RPG Introduction
 ILE RPG for AS/400 Programmers Guide
 RPG IV Overview
RPG IV Specifications
Control Specifications
Input Specifications
 Cycle Programming
The.When You Let Compiler Provide Logic For Your
 Last
Subprocedure logic
Indicators
First
 Example of an ILE RPG Program
Operation Codes
Program
Example of an ILE RPG
 File Description Specifications
Program
Second file
 Eval
Output Specifications
Bonus
Chain
 Not
Subprocedure
Heading Lines That Contain Constant String Payroll
ILE RPG
 Entire Source Program
Return
Fqsysprt Printer
 Not *IN99 Eval
Rate
Bonus PAY
10U 0 Value
 System Library
Commonly Used Control Language Commands
Interacting with the System
OS/400 System
 Application Development Manager
System Offers Full Set Tools That You May find usef
 Services
AS/400 Tools
ILE R
 Overview of the RPG IV Programming15 Language
 AS/400 Tools
 ILE RPG, ILE C, ILE Cobo
RPG Programming in ILE
Program Creation
RPG Programming in ILE
 Language You can Create
CRTSRVPGM, and Crtpgm commands. They can also Specified
 ILE
Procedure Followed Zero Or more subprocedures
Program Management
Program Call
 Source Debugging
Bindable APIs
While the progra
 Does Not Directly
Accesses Are Also Threadsafe
Multithreaded Applications
AS/400 now supports multithreading. ILE
 RPG Programming in ILE
 OPM-Compatible Application
Program Creation Strategies
Strategy 1 OPM-Compatible Application
Method
 Effect of ILE
Example of OPM-Compatible Program
 ILE Program Using Crtbndrpg
Related Information
Strategy 2 ILE Program
 Although Actual Storage Not Deleted As it
ILE Program Using Crtbndrpg Example of ILE Program
Shows Run-time view Application in which an ILE CL pr Calls
XYZ
 ILE Application Using Crtrpgmod
Using
Strategy 3 ILE Application
 Single-Language ILE Application
Scenario
 Mixed-Language ILE Application Scenario
Single-Language Application Using Crtrpgmod and Crtpgm
 Advanced Application Scenario
 Strategy to Avoid
Strategy to Avoid
 Activation Group
 Overview
Creating an Application Using Multiple Procedures
Multiple Procedures Module
Procedures
 Module
Prototyped Calls
What a module might
Like with Multiple Dures
 Numparm 30P 0 Value
Using prototyped calls you can call with the same syntax
FmtCust Name 100A Address
NumToChar
 Multiple
Example of Module with
Order to format Name Address Properly
Made Expression Shows Call
 Else
Example of Module with Multiple Procedures
DDS
ISO Move
 Procedures
 That
STATE, ZIP
ZIP
 Keyword on the control specificati
Module
Meaning that it consists only of subprocedur
Module, by Coding
 Fcustfile Disk Fcustrpt Printer
Entire Arrsrpt Program
 Endsr
Copy QRPGLE,CVTPROCP
Icustrec
Callp
 Return Else Endif
Following About
Arrsrpt
ISO Move Duedate
 DDS
 Coding Considerations
When Coding Module with multiple procedures You Will Want
Coding Considerations
General Considerations
 Cannot Contain Bound Procedure Calls
Main Procedure Considerations
Subprocedure Considerations
Contain a program entry procedure and only a
 For
Main Procedures
Subprocedures
For Further Information
 For Further Information
Prototyped Call
 Running an
Application
 ILE RPG for AS/400 Programmers Guide
 Creating a Library
Statements
File
Source
 Using the Source Entry Utility
Using SEU
Entry Utility
 Ippr
IPC
Ipcx
IPP
 Saved
Press F3 Exit To the Exit display. Type Y Yes to save
 DB2 UDB
Using SQL Statements
Using SQL Statements
Statements Calculation specification Start Your
 Statement Syntax Checking
Reference for more
Refer toADTS thefor AS/400 Source Entry
Utilitymanual for Information about How SEU handles
 Command
Using the Crtbndrpg Command
With
 Shows Their Default Values
You can use the Crtbndrpg Command interactively Batch From
 Creates View similar Compiler listing
Debugged Using a Source View Program Type
Creating a Program for Source Debugging
List
 Display Module Source
Binding
Creating a Program with Static
This example you create Program
 ¹ Wrkoutq queue-name
Command
Bnddir
¹ Wrkjob
 Empname Emprate
Disk Fqsysprt Printer
Chain Emprec Not *IN99
Payroll Register Date
 Obtaining a Compiler
Using a Compiler Listing
Using a Compiler Listing
Listing
 Xref
Customizing a Compiler Listing
Customizing a Page Heading
Compiler Listing
 PAGE/LINE
Last Update
Customizing the Spacing
Indenting Structured Operations
 This Will Add Sec Level text to the messages listed Message
Errors
Listing
Either Create
 SEU
Using In-Line Diagnostic Messages
FLD2
FLD1
 Source Entry Utility
Correcting Run-time Errors
Using Additional-Diagnostic Messages
Browsing a Compiler Listing Using SEU
 Specified, and in the column labeled as Sta Ment
Using a Compiler Listing for Maintenance
Expdds these are the defaults
Coordinating Listing Options with Debug View Options
 Data
Area
 Accessing the Returncode Data Area
 Accessing the Returncode Data Area
 Chapter
Commands
Creating
Module Object
 Command
Using the Crtrpgmod
You Create a Module using the Create
 Crtrpgmod MODULEMYLIB/TRANSSVC SRCFILEMYLIB/QRPGLESRC
Creating a Nomain Module
Requested
Creates a compiler listing which
 Related Files N/A Related Source Transrpt
¹ Dspjob
Then Select option Display4 spooled
Files
 Other
Endsl Return
Endsl
 Prototype for ProdName
Creating a Module for
Prototype for TransInc
Prod
 Ftrnsdta Disk Fqsysprt Printer
Itrnsrec
QTY
 Modules
Related CL Commands
RPG, mainthe procedureis
Additional Examples
 Binding Modules into a Program
Binding Modules into a Program
Binder
 Crtclmod
Using
Command
Into a
 Group
 Trpt
Export
Concepts for
Modules
 Using a Binder Listing
Using a Binder Listing
 Changing a Module or
Changing a Module or Program
 Level
Using the Updpgm Command
 Removing Observability
Size
Reducing an Objects
 Changing a
 Changing a Module or Program
 Dspsrvpgm Payroll DETAIL*PROCEXP *DATAEXP
Creating a Service Program
Service Program Overview
Service Program Overview
 Using Crtsrvpgm
Strategies for Creating Service Programs
Creating a Service Program Using Crtsrvpgm
Creating a Service Program
 Service Program Using Crtsrvpgm
Changing a Service Program
 Sample Service Program
Sample Service Program
API
 Ceedod
Opdesc
Const OPTIONS*VARSIZE
OPTIONS*VARSIZE
 DIV MVR
Exsr
Enddo
Begsr Eval
 Input String Charactern Output Hex string Character2 * n
Creating the Service Program
Parameters Crtsrvpgm command
Strpgmexp Signaturecvthex Export Symbolcvttohex Endpgmexp
 Call Cvthexpgm
Binding to a Program
Create the program by typing
Crtrpgmod MODULEMYLIB/CVTHEXPGM SRCFILEMYLIB/QRPGLESRC
 Clear
Copy RPGGUIDE/QRPGLE,CVTHEXPR
Clear Callp
Except
 Sample Binder Listing
Updating the Service
 Basic Binder listing for Cvthexpgm
 Sample Service Program
 103
Running a Program Using the CL Call Command
Running a Program Using
Running a Program
 Passing Parameters using
 106 shows DDS That is Referenced by the EMPRPT2 Source
 Selecting Option Design menus
Application
Running a Program From a Menu-Driven Application
Running a Program From a
 You Run Menu by Entering
Rpginq
RPGCHG, or Rpgadd respectively
 Replying to Run-Time Inquiry
Command
Running a Program Using User-Created
Replying to Run-Time Inquiry Messages
 Wheresequence-no
Ending an ILE Program
Groups
Managing Activation
 OFF
Managing Activation Groups
Specifying an Activation
Group
 Activation
Default
Compatibility
Running in the OPM
 Activation Groups Such
Reclaim Resources Command
Deleting an Activation
Group
 Referenceto Abridged
Managing the Default Heap Using RPG Operations
 Managing Dynamically-Allocated Storage
INZ*NULL
Dsply
 AddName 40A
Alloc
Elem@ = next@
 Namelen = %len%trimrname
= *NULL
 Null DOW
 Dealloc
Heap Storage Problems
 Call Somepgm
RPG procedure This
Managing Your Own Heap
Bindable APIs
 Dynarray
SeeAPI theReference
 Copy Dynarri
Ceegtst
Ceecrhp
 Subsalloc
Initalloc
 Enddo Dynainit
Reset
Dynainit
ADD Initalloc
 Realloc Begsr
Dynaset Export
Ifgt
Exsr Realloc Endif Eval
 Ifle
Else ADD Subsalloc
Enddo Endsr Dynaset
Dynaget Export
 Crtsrvpgm
Get Heap Storage
 127
Calling Programs and Procedures
Program/Procedure Call Overview
Program/Procedure Call Overview
 Calling Procedures
Calling Programs
Static
 Call Stack
Call stack
Stack
 Recursive Calls
Recursive calls are only allowed For
That Most r Stack Entry is Bottom
 Recent Caller
Parameter-Passing Considerations
 Program/Procedure Call Overview
 Callp
Using the Callp Operation
¹ Subprocedures in the same module
RPG Prototyped calls Are also Known
 30P
Using a Prototyped Call
Calling within an Expression
31A
 Passing by Reference
Examples of Free-Form Call
Passing Prototyped Parameters
Parameter Passing Styles
 Figures below
Passing by Value
 Docalc
Passing
Extprocdocalc
Docalc Export
 Using Operational Descriptors
ILE CEE API
Ceetsta Extprocceetsta
 Omit
When Calling Procedure You may sometimes want Leave Out Par
Omitting Parameters
OPTIONS*OMIT
 API Qcmdexc
Passing *OMIT
Leaving Out Parameters
OPTIONS*OMIT*NOPASS
 Psds
Passing Prototyped Parameters Checking for the Number
 Trimrprovince Return
Copy Fmtaddrp
OPTIONS*NOPASS Const
Eval Address = %TRIMRCSTREET# + +
 Begsr Movel
Check
Endif Endsr
 5P 0 DIM2 Ctdata
144
OPTIONS*NOPASS
Ctdata
 To create the program, PRTADDR, type
To create PRTADDR, using the source in on page 144, typ
Passing Less Data Than Required
Parameters
 Order of Evaluation
Interlanguage Calls
Effect
 DCL &RET2 TYPE*CHAR LEN2 DCL &RET1 TYPE*CHAR LEN1
Interlanguage
Calling Considerations
To obtain Actual Returned value
 Fixed-Form
Call Operations
 Using the Fixed-Form Call Operations
For Callb only
Operation Operation extender is Used With
 Operation
Passing Parameters Using Parm
Examples of Call and Callb
Operations
 Using the Plist Operation
Fixed-Form Call Operations
Plist
 Returning from a Called
Returning from a Main Procedure
Procedure
Normal End
 Returning from a Called Program or Procedure
Abnormal End
Entry Parm operation is perfor
 Retu
Returning from a Subprocedure
Without
For the AS/400 Reference
 APIs
Using Bindable APIs
Returning using ILE Bindable
Subprocedure ends abnormally
 Ceeutx
Examples of Using Bindable APIs
Calling a Graphics Routine
Calling a Graphics Routine
 TheGDDM Programming Guide
Calling Special Routines
Multithreading Considerations
Multithreading Considerations
 How to
Across
Share Data
 To Avoid Deadlock
Example, consider the situation where two procedures Called
Will Wait For MOD1 Unlock. Procedures Not
How
 MOD1
Considerations
PROC1
MOD2
 161
Debugging and Exception Handling
 ILE RPG for AS/400 Programmers Guide
 163
Debugging Programs
ILE Source Debugger
ILE Source Debugger
 Eval
Debug Commands
Attr
Equate
 Find
Tbreak
Thread
Watch
 Source
Order Debug it using
Preparing a Program for Debugging
Preparing a Program for
 Crtrpgmod MODULEMYLIB/DBGEX SRCFILEMYLIB/QRPGLESRC
Creating a Root Source View
Options On the Dbgview parameter for Either
Crtbndrpg PGMMYLIB/DEBUGEX SRCFILEMYLIB/QRPGLESRC
 Module
Listing View
View
Dbgview
 Program for Debugging
View
 Starting the ILE Source
Starting the ILE Source Debugger
OPMSRC*NO
 Into
Setting Debug Options
Strdbg Example
Start a Debug Session for the sample debug program Debugex
 OPM source debug support field,
SET
 Debug Session
Example of Adding a Service
Example of Removing ILE Programs from a Debug Session
Adding/Removing Programs from a Debug Session
 Lstdbg ILE
Viewing the Program Source
Viewing the Program Source
Cobol
 Viewing a Different
Dbgex
Libl PGM
 Cproc
Changing the View of a
Module
Several Different views
 OPTION*NODEBUGIO
Setting and Removing Breakpoints
Setting and Removing Breakpoints
Specified You Not Erate Breakpoints Specify
 Breakpoints
Setting and Removing
With the source positioned at the line where the breakpoint
Debug Command to set a job breakpoint
 Setting an
Job
Breakpoint
 Greater Than Equal To one
Setting and Removing Unconditional Thread Breakpoints
Debug Command Sets a Thread breakpo Single Current
Debug
 Breakpoints
Job
 Work with Module Breakpoints
Example of Setting a Conditional Job Breakpoint Using F13
Line
Conditional Breakpoint
 National Language Sort Sequence Nlss
Command
Setting a Conditional Job Breakpoint Using
Break 128 when BigDate=1994-09-30
 Sort Sequence
Control Spec Tion Is not available
 Varia
On the debug command line
One procedure per module,procedurethe -namecan Either
Main procedure or one of the subprocedures
 Listing, type
This Example Statement View Is used to Set Breakpoint For
Set a breakpoint for Module With
Set Breakpoint For Module with
 Main Procedure Exit
Setting and Removing Conditional Thread Breakpoints
Using the Work with Module Breakpoints Display
Procedurevariables-name and statement-number
 Conditions
Debug Commands
Setting and Removing Watch Conditions
Removing All Job
 You Debug One Job From Another
Characteristics of Watches
Display
Program statemen
 Salary
Setting Watch Conditions
On the debug command line, without any parameters
Watch
 ¹ To specify a variable or expression to be watched, type
Payroll ABC PGM
Payroll
 IPL
Displaying Active Watches
Removing Watch Conditions
Enddbg
 Display as shown below. Instead
Example of Setting a Watch Condition
Example of Setting a Watch Condition
BlankDisplay Module Source
 Object
Stepping Through the Program Object
Stepping Through
 Over Into Subprocedures
Stepping Over Call Statements
Subroutines You Can
 Stepping Into Call Statements
Step Into
TIP
 Debugex
F22
This example, you use F22 Step Into to step Into the OPM
From Program
 This example, you use F22 Step Into to Subpr Which Module
InputParm
Step completed at line
 Switch
Displaying Data and Expressions
Else
 Const
On page 201 shows Use
 Date, Time, Timestamp Fields
Unexpected Results when Evaluating Variables
Scalar Fields RPG Definition
Based Fields
 Displaying the Contents of a Table
Displaying the Contents of an Array
 Eval DS12
Displaying Data Structures
 Which is discussed Below
Displaying Indicators
 Character Format
Displaying Fields as Hexadecimal Values
 Displaying Null-Capable Fields
Data
Displaying Variable-Length Fields
By Pointers
 String = 1ABCD6
STRING=%SUBSTRBIGDATE 1 4 =
 Fields
 = Abcdef
Changing the Value of Fields
 Equating a Name with
Or Command
Equating a Name with a Field, Expression, or Command
Displaying Attributes of a Field
 For
Sample Source for Debug Examples
Examples
 First Module
Program using Source 215, type
Sample Source for Debug Examples
To create the program DEBUGEX, type
 DS2
DIM3 Ctdata
DS1
Inzabcde
 Occur DS2 Move
Plist Parm
Call Rpgpgm
 Dsply Seton
Dump Seton
Else Eval
Entry Plist Parm
 Source for C Procedure cproc. cproc is called by Dbgex
 217
Handling Exceptions
Exception Handling Overview
Exception Handling Overview
 Call st
Indicates That Severe error has been detected
Program Procedure P1 is Contro Boundary
Describes Status Work Being done by a program
 Active on
Exception Message
 Dure will Only Handle Errors That Subprocedure
ILE RPG Exception Handling
Exception Handling within
 Operation For
 PGM C
OPM
 Nested Exceptions
Using Exception Handlers
Using Exception Handlers
Exception Handler Priority
 PRC1
For other Types Messages
Escape Message
PGM2
 PGM2, each Containing a procedur
Example of Unhandled Function Check
Operation as well
PGM1
 Built-in-functions
Using RPG-Specific Handlers
Optimization Considerations
For More Information Optimization See Changing Level
 ILE RPG For AS/400 Reference provides
This Section Provides Some Examples How to Use Each These R
Infsr error Subroutines, on Exsr Operation Code Infds
Extender
 Explicitly c
Using an Error Subroutine
Program Error
Operation. If Either
 Using a File Error Infsr Subroutine
 Status
INFSRPrdInfsr INFDSPrdInfds
Disk Ftrnbacklg O Fprint Printer
PrdInfds PrdStatus
 Infds
 Operation With Factor Entry
Using a Program Error Subroutine
Position Definition Specification Enter
After Keyword
 Move Getin
Parms
Proc Body of Code Goes Here
Pssr Begsr
 Try again Err =
If this is a divide-by-zero error, add 1 to the divisor
If control reaches ENDSR, the procedure will fail
TAG DIV
 Subrou
Exceptions Order Show how to avoid looping Within
Pssr
Which is designed to ge
 After the Else
Move Inlr
Else ADD
 OFL
Specifying a Return Point
 Handlers
Using a Condition Handler
ILE Condition Handlers
ILE Condition Handlers
 Action 10I OutCondTok LIKECondTok
132
Printer Rpghdlr
LIKECondTok
 Communication Area Which Contains Pointer
Shows Source For Procedure
Is registered Procedure Parameters Include Pointer
Condition Handler
 Ceehdlu
ARR1
 Proc
Procptr
Noopt
SDS Noopt
 Begsr Callp
Subst
 Ceeutx ILE
Cancel Handlers
244
Ceertx
 Return Endsr
Procedure to SubProc will not fail
Pssr has a Return operation, so the call from the main
Subproc Pssrdsply
 Select When
INZ0 Static
Callb Ceertx Parm
Parm Omit
 Likely Occur With
RPG using
Condition Handlers Enabled Using
Cancel Hdlr Dsply Msg CanHdlr
 Endif Return
Condition Handler that Ignores CPF4906
 MsgSev = Warning
Handle information or warning messages, otherwise percolate
 ILE RPG for AS/400 Programmers Guide
 Obtaining an ILE RPG Formatted Dump
Using the Dump Operation Code
Using the Dump Operation Code
Obtaining a Dump
 Formatted Dump
¹ If a Dump operation is bypassed By a Goto operation,
Does not Occur
 Dump
 Qspl
Example of a Formatted Dump
 Dump
Agement
 Part 1 of 2. Data section of Formatted Dump
 125 Part Data section of Formatted Dump
 Order Which they are defined Gaps
Beginning of user variables, listed in alphabetical order,
 259
Working with Files and Devices
 ILE RPG for AS/400 Programmers Guide
 261
Defining Files
Associating Files with Input/Output Devices
Associating Files with Input/Output Devices
 Write
Compilation Time Certain
Operation Device Dependent Device dependency Is that
Operation Code is Valid Only
 Naming Files
Types of File Descriptions
Types of File Descriptions
 Example of Some Typical Relationships between
Using Files with
Program-Described
Files
 Defining Externally Described Files
Defining Externally Described
OPTION*EXPDDS
 Nbrofcharreplaced. Figure
Renaming Record-Format Names
Ignoring Record Formats
Renaming Field Names
 External
Using Input Specifications
Modify an
Description
 Used Program This Example Field
You Then Fixed Name Specification Will Get Error
Indicator Record
Files
 Using Output Specifications
 ALL
Level Checking
For Character Fields zero
Is written
 SEQ Special
Defining Program-Described Files
Data Management Operations and ILE RPG I/O Operations
RPG I/O Operations
 Delete
Data Management Operations and ILE RPG I/O Operations
 273
File Considerations
Overriding and Redirecting File Input and Output
Overriding and Redirecting File Input and Output
 FMT1
Input Output
Input Output
Example of Redirecting
 Program Can Chang Allocate Object
File Locking
File Locking
Data Management manual
 Record Locking
Record Locking
 Control For More Information
See Using
Path
Sharing an Open Data
 Can Specify
Spooling
Spooling
Program Details System Open Options Allowed for Each
 Program Versus
Output Spooling
 SRTSEQ/ALTSEQ
 Data Files and Source
Accessing
Database Files
Physical Files and Logical Files
 Using Externally Described Disk Files
Using Externally Described Disk Files
Record Format Specifications
Access Path
 Contained Physical file CUSMSTP, which is Identified
Unique
Unique
 Addr Reffldname
Dstref Distribution Application Field Reference
Basdat Edtcdey
Cust Checkmf
 Edtcdej
Valid Keys for a Record File
Disk
City
 Arguments
Partial Key
Referring to
 Used,
Record Blocking and Unblocking
 Valid
Using Program-Described Disk Files
Using Program-Described Disk Files
Indexed File
 Logical file ORDDTLL. For the two fields
Keyword specifies position 15 as the starting po
 Move Order KEY Chain
Sequential File
Record Address File
10AIDISK
 Methods for Processing Disk Files
Methods for Processing Disk Files
Limits Records
Relative Record Numbers
 Consecutive Processing
Subsequent Text Describes Each Method Processing
ADD
 Database Programming manual
Sequential-by-Key Processing
Examples of Sequential-by-Key Processing
Database Programming
 Weekly hours worked
Example, the employee master record
 Iemprec Ircweek
YTDRPT1 Related Files EMPL1
Fprint
FEMPL1 Disk
 Eofend TAG Seton
YTDRPT2 Related Files EMPL1
Setoff Read EMPL1 Goto Eofend Move Enum Empno
Seton Endif
 Records Are Processed as Matching records With
For Processing Disk Files
 ADD Ovthrs Totovt Seton Endif Oprint
ADD Tothrs Totovt Setoff
ADD Ehwrk Tothrs
SUB Enhrs Ovthrs
 Nnhrs
Random-by-Key Processing
Example of Random-by-Key Processing
Emstupd Descriptions
 Sequential-within-Limits Processing
Change
Fchange
 Disk Files
Examples of Sequential-within-Limits Processing
 3PIDISK KEYLOC1 Fprint
ESWLIM1 Related Files Empmst
Limits
Flimits Disk
 Relative-Record-Number Processing
ESWLIM2 Related Files Empmst
Fempmst Disk Fprint
 Valid File Operations
Valid File Operations
 Z/F
 Recno
 Using Commitment Control
Using Commitment Control
Starting and Ending Commitment
 See theBackup and Recovery manual
Commitment Control Locks
Abridged for
 Concepts,
Using
Files For
Specifying
 Example of Using Commitment Control
Receiver
Journal
 Disk Commit Ftrans
This command calls the program Revise
Update Mastrec Tranrec
Control
 Cycle
DDM Files
DDM Files
 ReferDistributedto the Data
Pre-V3R1 DDM
 DDM Files
 315
Accessing
Types of Device Files Chapter
Attached
 Handling Page Overflow
Accessing Printer Devices
Accessing Printer Devices
Specifying Printer Files
 Overflow
 On an and notline,anoverflowthe linelineis
 Account
Example of Printing Headings on Every
Example of Printing a Field on Every
OANL2
 Using the Fetch-Overflow
Routine in Program-Described Files
Overf
 Overflow Printing Setting of the Overflow Indicator
 Example of Specifying Fetch Overflow
Fetch Overflow
 Changing Forms Control
File
OPM Prtctl data structure
 Values Contained First four subfields
Dat
Forms
 File Name Associated Data Structure is
Accessing Tape Devices
Accessing Tape Devices
Print
 Ovrdbf
Accessing Display Devices
Using Sequential Files
Using Sequential Files
 Program name
Using Special Files
Using Special Files
File
 Error
Status
Description
 Spcl Plist Parm FLD1 Movel Hello Write Excptn Outbuf Seton
Example of Using a Special File
Special Pgmnameuserio
FLD
 Are Added To the end of the RPG-created Parameter list
Program User-written routine
Userio
 Using Workstn Files
Using Externally Described Workstn Files
Function
 On page 333 shows an example of the DDS for a display-devic
¹ Output
 Descrp
Refdstref
Prompt
Overlay
 Specifying Function Key Indicators on Display Device Files
Specifying Command Keys Display
Device
 Processing an Externally Described Workstn File
Using Subfiles
 Sfile
Field
 SFL TEXTSubfile Record
Use of Subfiles
You press Specified Function key During Read
Name Search
 Using Program-Described Workstn Files
Using Program-Described Workstn Files
Subfil
 With
Using a Program-Described
 Format
Input Specifications
Calculation Specifications
Name
 Combined File
Valid Workstn File Operations
Input File
Output File
 Multiple-Device Files
Exfmt Operation
Read Operation
Write Operation
 Is updated
Devid
Keyword. This field Initialized
 Multiple-Device Files
 345
Example of an Interactive Application
Database Physical File
Database Physical File
 Main Menu Inquiry
Inquiry
DDS for a
Display Device
 Cusmain RPG Source
 Using Crtrpgmod Create Program By entering
First option specifies that the first module in the list
Main menu will appear as in on
 Logical
File Maintenance
File Maintenance
CUSMSTL1 DDS for a
 Device
Display
 Mode
70DATE Edtcdey
Edtcdez
 Cusmnt RPG Source
Record Format contains Constant Customer File Maintenance
 Subroutine Addsub Purpose
Addsub Begsr Cstkey Chain CMLREC1 Not *IN50 Move
Else Move OFF
 Move Display Mode Endsl MODE1 Endsr
Move ADD Mode When
Move Update Mode When
Move Delete Mode When
 223021
Display Mode
Customer File Maintenance
Cstinq
 223143
On page 357 a new customer is added to the Customer Mast
223106
30/94 Customer 00007
 ADD Mode
Delete Mode
Bathurst Avenue
 Code
Zip
Search by
Search by Zip Code
 REFCUSMSTL2 Printqsysprt Indara
Szipmenu
Related Files CUSMSTL2
File SZIPMENU. IT has
 Indicates when to display Subfile When Indicator 55 is
 Schzip RPG Source
 Write Subctl Move OFF
Move OFF
ADD Zero Recnum Endsr
 Subfile Is written to the screen as shown in on
File indicator 71 on th
Zip
Routine Fills Subfile Record Read From
 Identifies Name field Key Fields
Search and Inquiry by Name
Search and Inquiry by Name
For Database File Used This Program Defines one reco
 Subfile
Device File
Snammenu DDS for a Display
FOOT2
 File by the Setll OPERATION. then IT Displays
Records Using Subfiles
Schnam RPG Source
This Program Prompts the User for the Customer
 Example of an Interactive 367Application
 Inc
File Indicator On the Read operation
File Record Count
Recnum
 Judah Gould
 Yorktown
Inquiry by Name
233948 30/94 Customer 00012 Name
Gould
 371
Appendixes
 ILE RPG for AS/400 Programmers Guide
 Differences
RPG/400 ILE
For AS/400
Appendix
 Debugging and Exception
Running
 RPG III
 Will Issue
Will issue the RNQ1222 inquiry Message
RPG/400 Will Issue
Will issue the RNQ1022 inquiry Message
 Dbcs Data in Character Fields
Compiler Such Programs Will Get Compilation errors
 Differences Between OPM RPG/400
 Hurry
Appendix B. Using
Conversion Overview
379
 File Record Length
File Considerations
 Log File
Conversion Aid Tool Requirements
USE
 Aid
Wont Do
Converting Your Source
Converting Your Source
 Cvtrpgsrc Command
 Frommbr
Fromfile
Libl
Curlib
 Tombr
Tofile
Qrpglesrc
None
 Seclvl YES Insrtpl
Expcpy
YES
Cvtrpt
 Defaults
Converting a Member Using
Source
 Cvtrpgsrc FROMFILEOLDRPG/QRPGSRC Frommbrpayroll TOFILE*NONE
Converting All Members in a File
Performing a Trial Conversion
Converting Some Members
 CVTRPT*NO
Obtaining Conversion Reports
Converting Auto Report
Source Members
 Example of Source Conversion
Inserting Specification Templates
Data
Example of Source Conversion
 Example Source Conversion
To convert this source, enter
Converted source is shown in on
 ARR2
 DS1
III specifications for ARR2. The Conversion Aid
Analyzing Your Conversion
Analyzing Your Conversion
 Conversion Aid generates a conversion report if you specify
Using the Conversion
Shows Command summary for a sample Conversion
Report
 Call PROG1
Your
 Using the Log File
 Lgtime Colhdgcvt Time
Qrncvtfm Lgcent Colhdgcvt Cent
Lgdate Colhdgcvt Date
Ymmdd
 Use of the /COPY
Resolving Conversion Problems
Compilation Errors in Existing RPG III Code
Unsupported RPG III Features
 TEST1
 Comp
Context-Sensitive Problems
Records Using
Members in the converted RPG IV source member
 Char
Command Or manually Correct Code After Conversion
Use of Externally
Structures
 Extrec
When converted
Merging an Array with an Externally Described DS Subfield
Initializing
 Dsone Extnameextrec Char
Run-time Differences
Behavior With
XYZ
 Resolving Conversion Problems
 Reading Syntax Diagrams
Appendix C. The Create Commands
Using CL Commands
How to Interpret Syntax Diagrams
 KEYWORDREQUIRED-VALUE
Crtbndrpg Command
Crtbndrpg Command
Values
 Appendix C. The Create Commands407
 Srcfile
Description of the Crtbndrpg Command
PGM
Program-name
 Srcmbrtxt
Srcmbr
Genlvl
Text
 Nogen
Option
Noxref
GEN
 Elseif
Noext
 List
Eventf
Dbgview
Stmt
 Optimize
ALL
Output
Print
 Varchar
Cvtopt
Datetime
Graphic
 User
Langid
Replace
Usrprf
 Exclude
Issued
Change
USE
 PRV
Fixnbr
Zoned
Tgtrls
 Binding-directory-name
Alwnull
Inputonly
Bnddir
 NEW
Usrlibl
Actgrp
Qile
 Nocol
Crtrpgmod Command
Crtrpgmod Command
Prfdta
 Appendix C. The Create Commands421
 PF1
Description of the Crtrpgmod command
Usrprf
PF4
 Appendix D. Compiler Listings
Compiler Listings
423
 Crtb
Which was Compiled Using
Compiler Listing
Reading a
 Indentation Mark
Module or Program
Source member
Compiler options
 Section
Endif
Eject
 Sequence Numbers Root
Listings
 Part 1 of 3. Sample Source Part of the Listing
 Part 2 of 3. Sample Source Part of the Listing
 Do Number
1a/ *NOSRCSTMT Source Heading
Line Number
Ruler Line
 Additional
Diagnostic
 Copy Member Table
Output Buffer Positions
 Alternate Sequence
Compile-Time Data
Total Number of Characters Altered
Character to be Altered
 Cross-Reference Table
Key Field Information
 Duedate
External References List
 Final Summary
Message Summary
 N a L M M a R Y
Code Generation and Binding Errors
 Compiler Listings
 439
Bibliography
 Iddu
 ILE RPG
 ILE RPG for AS/400 Programmers Guide
 Special
443
Characters
 See
 Ceeutx
 See AlsoILE
 Control-record format, subfile Create Program
 Dbcs
 Describing
 Dsppgmref
 Binder Listing 100 Exception Service
 Find
 See halt
 See file
 See last
 See long
 Plist
 Methods
 Qual
 OA-OG, OV
 SEU
 See DB2
 Totc
 ILE RPG for AS/400 Programmers Guide
 Éâôù