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