在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例Clojure → IBM AS400 RPGLE编程指导

IBM AS400 RPGLE编程指导

Clojure

下载此实例
  • 开发语言:Others
  • 实例大小:3.69M
  • 下载次数:3
  • 浏览次数:105
  • 发布时间:2022-04-10
  • 实例类别:Clojure
  • 发 布 人:王巍
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: IBM 400 指导 00 编程

实例介绍

【实例简介】IBM AS400 RPGLE编程指导

【实例截图】

【核心代码】

Contents
ILE RPG Programmer's Guide
About ILE RPG Programmer's Guide 1-1
Who Should Use This Guide . . . . . . . . 1-1
Prerequisite and Related Information . . . . . 1-1
How to Send Your Comments . . . . . . . . 1-1
What's New . . . . . . . . . . . . 2-1
What's New since 7.2? . . . . . . . . . . 2-1
What's New in 7.2? . . . . . . . . . . . 2-5
What's New in 7.1? . . . . . . . . . . . 2-12
What's New in 6.1? . . . . . . . . . . . 2-16
What's New in V5R4? . . . . . . . . . . 2-20
What's New in V5R3? . . . . . . . . . . 2-24
What's New in V5R2? . . . . . . . . . . 2-27
What's New in V5R1? . . . . . . . . . . 2-30
What's New in V4R4? . . . . . . . . . . 2-35
What's New in V4R2? . . . . . . . . . . 2-38
What's New in V3R7? . . . . . . . . . . 2-42
What's New in V3R6/V3R2? . . . . . . . . 2-45
ILE RPG Introduction . . . . . . . . 3-1
Overview of the RPG IV Programming Language 3-1
RPG IV Specifications. . . . . . . . . . 3-1
Cycle Programming . . . . . . . . . . 3-2
Subprocedure logic . . . . . . . . . 3-3
Indicators. . . . . . . . . . . . . . 3-3
Operation Codes . . . . . . . . . . . 3-4
Example of an ILE RPG Program . . . . . . 3-4
Using IBM i . . . . . . . . . . . . 3-10
Interacting with the System . . . . . . 3-10
Rational Development Studio for i . . . . . 3-11
RPG Programming in ILE . . . . . . . . . 3-11
Program Creation. . . . . . . . . . . 3-12
Program Management . . . . . . . . . 3-13
Program Call . . . . . . . . . . . . 3-14
Source Debugging . . . . . . . . . . 3-14
Bindable APIs . . . . . . . . . . . . 3-14
Multithreaded Applications . . . . . . . 3-15
Program Creation Strategies . . . . . . . . 3-16
Strategy 1: OPM-Compatible Application . . . 3-16
Method . . . . . . . . . . . . . 3-16
Example of OPM-Compatible Program . . 3-17
Effect of ILE . . . . . . . . . . 3-17
Related Information . . . . . . . . . 3-17
Strategy 2: ILE Program Using CRTBNDRPG 3-18
Method . . . . . . . . . . . . . 3-18
Example of ILE Program Using
CRTBNDRPG . . . . . . . . . . . 3-18
Effect of ILE . . . . . . . . . . 3-19
Related Information . . . . . . . . . 3-20
Strategy 3: ILE Application Using
CRTRPGMOD . . . . . . . . . . . . 3-20
Method . . . . . . . . . . . . . 3-20
Single-Language ILE Application Scenario 3-21
Mixed-Language ILE Application Scenario 3-21
Advanced Application Scenario . . . . . 3-22
Related Information . . . . . . . . . 3-23
A Strategy to Avoid . . . . . . . . . . 3-23
Creating an Application Using Multiple
Procedures . . . . . . . . . . . . . . 3-24
A Multiple Procedures Module — Overview 3-25
Main Procedures and Subprocedures . . . 3-25
Prototyped Calls . . . . . . . . . . 3-26
Example of Module with Multiple Procedures 3-28
The Entire ARRSRPT Program . . . . . 3-31
Coding Considerations . . . . . . . . . 3-35
General Considerations . . . . . . . . 3-35
Program Creation. . . . . . . . . . 3-35
Main Procedure Considerations . . . . . 3-36
Subprocedure Considerations. . . . . . 3-36
For Further Information . . . . . . . . 3-37
Main Procedures . . . . . . . . . . 3-37
Subprocedures. . . . . . . . . . . 3-37
Prototyped Call . . . . . . . . . . 3-37
Creating and Running an ILE RPG
Application . . . . . . . . . . . . 4-1
Using Source Files . . . . . . . . . . . . 4-1
Using Source Physical Files . . . . . . . . 4-1
Creating a Library and Source Physical File 4-1
Using the Source Entry Utility (SEU). . . . 4-2
Using SQL Statements . . . . . . . . 4-5
Using IFS Source Files . . . . . . . . . 4-7
Include files . . . . . . . . . . . . 4-7
Search Path Within The IFS . . . . . . 4-8
Creating a Program with the CRTBNDRPG
Command . . . . . . . . . . . . . . 4-9
Using the CRTBNDRPG Command. . . . . 4-10
Creating a Program for Source Debugging 4-12
Creating a Program with Static Binding . . 4-13
Creating an OPM-Compatible Program
Object . . . . . . . . . . . . . 4-13
Using a Compiler Listing . . . . . . . . 4-15
Obtaining a Compiler Listing. . . . . . 4-16
Customizing a Compiler Listing . . . . . 4-17
Customizing a Page Heading . . . . . 4-17
Customizing the Spacing . . . . . . 4-17
Indenting Structured Operations. . . . 4-17
Correcting Compilation Errors . . . . . 4-18
Using In-Line Diagnostic Messages . . . 4-19
Using Additional-Diagnostic Messages 4-19
Browsing a Compiler Listing Using SEU 4-20
Correcting Run-time Errors . . . . . . 4-20
Coordinating Listing Options with Debug
View Options . . . . . . . . . . 4-20
Using a Compiler Listing for Maintenance 4-21
Accessing the RETURNCODE Data Area . . . 4-21
© Copyright IBM Corp. 1994, 2013 iii
||
||
# #
Creating a Program with the CRTRPGMOD and
CRTPGM Commands . . . . . . . . . . 4-23
Creating a Module Object . . . . . . . . 4-23
Using the CRTRPGMOD Command . . . 4-24
Creating a NOMAIN Module. . . . . 4-25
Creating a Module for Source Debugging 4-28
Additional Examples . . . . . . . . 4-30
Behavior of Bound ILE RPG Modules . . . 4-30
Related CL Commands . . . . . . . . 4-30
Binding Modules into a Program . . . . . 4-30
Using the CRTPGM Command . . . . . 4-33
Binding Multiple Modules. . . . . . 4-34
Additional Examples . . . . . . . . 4-35
Related CL Commands . . . . . . . . 4-35
Using a Binder Listing . . . . . . . . . 4-36
Changing a Module or Program . . . . . . 4-36
Using the UPDPGM Command . . . . . 4-37
Changing the Optimization Level . . . . 4-37
Removing Observability . . . . . . . 4-38
Reducing an Object's Size . . . . . . . 4-38
Creating a Service Program . . . . . . . . 4-38
Service Program Overview . . . . . . . 4-39
Strategies for Creating Service Programs . . . 4-39
Creating a Service Program Using
CRTSRVPGM . . . . . . . . . . . . 4-40
Changing A Service Program . . . . . . 4-40
Related CL commands . . . . . . . . 4-41
Sample Service Program . . . . . . . . 4-41
Creating the Service Program. . . . . . 4-44
Binding to a Program . . . . . . . . 4-45
Updating the Service Program . . . . . 4-46
Sample Binder Listing . . . . . . . . 4-47
Running a Program . . . . . . . . . . . 4-48
Running a Program Using the CL CALL
Command . . . . . . . . . . . . . 4-48
Passing Parameters using the CL CALL
Command . . . . . . . . . . . . 4-48
Running a Program From a Menu-Driven
Application. . . . . . . . . . . . . 4-51
Running a Program Using a User-Created
Command . . . . . . . . . . . . . 4-52
Replying to Run-Time Inquiry Messages . . . 4-53
Ending an ILE Program. . . . . . . . . 4-54
Managing Activation Groups . . . . . . . 4-54
Specifying an Activation Group . . . . . 4-54
Running in the OPM Default Activation
Group . . . . . . . . . . . . . 4-55
Maintaining OPM RPG/400 and ILE RPG
Program Compatibility . . . . . . . . 4-55
Deleting an Activation Group. . . . . . 4-56
Reclaim Resources Command. . . . . . 4-56
Managing Dynamically-Allocated Storage . . 4-57
Managing the Default Heap Using RPG
Operations . . . . . . . . . . . . 4-58
Heap Storage Problems. . . . . . . . 4-63
Managing Your Own Heap Using ILE
Bindable APIs . . . . . . . . . . . 4-64
Calling Programs and Procedures . . . . . . 4-71
Program/Procedure Call Overview . . . . . 4-72
Calling Programs . . . . . . . . . . 4-72
Calling Procedures . . . . . . . . . 4-73
The Call Stack . . . . . . . . . . . 4-73
Recursive Calls . . . . . . . . . . 4-74
Parameter-Passing Considerations . . . . 4-77
Using a Prototyped Call . . . . . . . . 4-78
Using the CALLP Operation . . . . . . 4-79
Calling within an Expression . . . . . . 4-79
Examples of Free-Form Call . . . . . . 4-80
Passing Prototyped Parameters . . . . . . 4-80
Parameter Passing Styles . . . . . . . 4-80
Passing by Reference . . . . . . . 4-81
Passing by Value . . . . . . . . . 4-81
Passing by Read-Only Reference. . . . 4-81
Advantages of passing by value or
read-only reference . . . . . . . . 4-81
Choosing between parameter passing
styles . . . . . . . . . . . . . 4-82
Using Operational Descriptors . . . . . 4-83
Omitting Parameters. . . . . . . . . 4-84
Passing *OMIT . . . . . . . . . 4-84
Leaving Out Parameters . . . . . . 4-85
Checking for the Number of Passed
Parameters . . . . . . . . . . . . 4-85
Using %PARMS . . . . . . . . . 4-85
Passing Less Data Than Required . . . . 4-90
Passing File Parameters. . . . . . . . 4-91
Order of Evaluation . . . . . . . . . 4-91
Interlanguage Calls . . . . . . . . . 4-91
Interlanguage Calling Considerations . . . . 4-93
Using the Fixed-Form Call Operations. . . . 4-93
Examples of CALL and CALLB . . . . . 4-94
Passing Parameters Using PARM and PLIST 4-94
Using the PARM operation . . . . . 4-94
Using the PLIST Operation . . . . . 4-95
Returning from a Called Program or Procedure 4-96
Returning from a Main Procedure . . . . 4-96
Normal End for a Cycle-Main Procedure 4-96
Abnormal End for a Cycle-Main
Procedure . . . . . . . . . . . 4-97
Returning without Ending for a
Cycle-Main Procedure . . . . . . . 4-97
Returning from a Subprocedure . . . . . 4-98
Returning using ILE Bindable APIs . . . . 4-98
Using Bindable APIs. . . . . . . . . . 4-98
Examples of Using Bindable APIs . . . . 4-99
Calling a Graphics Routine . . . . . . . 4-99
Calling Special Routines . . . . . . . . 4-100
Storage Model . . . . . . . . . . . 4-100
Considerations for the single-level storage
model . . . . . . . . . . . . . 4-101
Considerations for the teraspace storage
model . . . . . . . . . . . . . 4-101
Considerations for the inherit storage
model . . . . . . . . . . . . . 4-101
Recommendations for the storage model of
programs and service programs . . . . 4-101
Multithreading Considerations . . . . . . 4-101
Running Concurrently in Multiple Threads 4-102
Running Serialized in Multiple Threads 4-102
Activation Group Considerations for the
THREAD keyword . . . . . . . . . 4-102
iv IBM i: ILE RPG Programmer's Guide
# #
#
# #
#
# #
#
# #
#
# #
#
# #
Storage that is Shared Among Multiple
Threads . . . . . . . . . . . . 4-103
How to Avoid Deadlock Between Modules 4-103
All-Thread Static Variables . . . . . . 4-104
When to use a serialized procedure . . . 4-105
When a serialized procedure does not
provide sufficient protection. . . . . . 4-106
Difficulty of manually synchronizing access
to shared resources . . . . . . . . . 4-106
Using thread-related APIs . . . . . . 4-107
How to build the examples . . . . . 4-107
How to run the examples . . . . . 4-107
RPG and the eBusiness World . . . . . . . 4-119
RPG and XML . . . . . . . . . . . 4-119
Processing XML Documents . . . . . . 4-120
XML Parser Error Codes . . . . . . 4-121
Limitations of the XML Parser . . . . 4-123
RPG and MQSeries . . . . . . . . . . 4-125
RPG and Java . . . . . . . . . . . 4-125
Introduction to Java and RPG . . . . . 4-125
The Object Data Type and CLASS
Keyword . . . . . . . . . . . 4-126
Prototyping Java Methods . . . . . 4-126
Calling Java Methods from ILE RPG . . . 4-129
Creating Objects. . . . . . . . . 4-133
Calling methods in your own classes . . . 4-134
Controlling how the Java Virtual Machine
is set up . . . . . . . . . . . . 4-135
RPG Native Methods . . . . . . . . 4-135
Getting the Instance Parameter in
Non-Static Native Methods . . . . . 4-137
Passing Character Parameters from Java
to Native Methods . . . . . . . . 4-137
Coding Errors when calling Java from RPG 4-138
Incorrectly specifying the method
parameters in the RPG prototype . . . 4-138
Failure to free Java resources . . . . 4-139
Using objects that no longer exist . . . 4-140
Additional RPG Coding for Using Java 4-140
Telling Java to free several objects at
once . . . . . . . . . . . . . 4-141
Telling Java you are finished with a
temporary object . . . . . . . . 4-141
Telling Java you want an object to be
permanent. . . . . . . . . . . 4-142
Telling Java you are finished with a
permanent object . . . . . . . . 4-143
Creating the Java Virtual Machine (JVM) 4-144
Obtaining the JNI environment pointer 4-144
Handling JNI Exceptions . . . . . . 4-148
Additional Considerations . . . . . . 4-149
Common Runtime Errors. . . . . . 4-149
Debugging Hints . . . . . . . . 4-149
Creating String objects in RPG . . . . 4-149
Getting information about exceptions
thrown by called Java methods . . . . 4-150
Advanced JNI Coding . . . . . . . . 4-150
Setting an Object Reference in the jvalue
Structure . . . . . . . . . . . 4-150
Converting Java Character Data . . . 4-152
Accessing Fields in Java Classes . . . 4-152
Calling Java Methods Using the JNI
Rather than RPG *JAVA Prototypes . . 4-155
Calling RPG programs from Java using
PCML . . . . . . . . . . . . . 4-156
PCML Restrictions . . . . . . . . 4-157
Debugging and Exception Handling 5-1
Debugging Programs . . . . . . . . . . . 5-1
The ILE Source . . . . . . . . . . . . 5-2
Debug Commands. . . . . . . . . . 5-2
Preparing a Program for Debugging . . . . . 5-4
Creating a Root Source View . . . . . . 5-5
Creating a COPY Source View . . . . . . 5-5
Creating a Listing View . . . . . . . . 5-6
Creating a Statement View . . . . . . . 5-6
Starting the ILE Source . . . . . . . . . 5-7
STRDBG Example . . . . . . . . . . 5-8
Setting Debug Options . . . . . . . . 5-9
Adding/Removing Programs from a Debug
Session . . . . . . . . . . . . . . 5-9
Example of Adding a Service Program to a
Debug Session. . . . . . . . . . . 5-10
Example of Removing ILE Programs from a
Debug Session. . . . . . . . . . . 5-10
Viewing the Program Source . . . . . . . 5-11
Viewing a Different Module . . . . . . 5-11
Changing the View of a Module . . . . . 5-12
Setting and Removing Breakpoints . . . . . 5-13
Setting and Removing Unconditional Job
Breakpoints. . . . . . . . . . . . 5-14
Example of Setting an Unconditional Job
Breakpoint . . . . . . . . . . . 5-15
Setting and Removing Unconditional Thread
Breakpoints. . . . . . . . . . . . 5-16
Setting and Removing Conditional Job
Breakpoints. . . . . . . . . . . . 5-16
Example of Setting a Conditional Job
Breakpoint Using F13 . . . . . . . 5-17
Example of Setting a Conditional Job
Breakpoint Using the BREAK Command . 5-18
National Language Sort Sequence (NLSS) 5-19
Setting and Removing Job Breakpoints
Using Statement Numbers. . . . . . . 5-20
Setting and Removing Conditional Thread
Breakpoints. . . . . . . . . . . . 5-22
Using the Work with Module Breakpoints
Display . . . . . . . . . . . . 5-22
Using the TBREAK or CLEAR Debug
Commands . . . . . . . . . . . 5-22
Removing All Job and Thread Breakpoints 5-23
Setting and Removing Watch Conditions . . . 5-23
Characteristics of Watches . . . . . . . 5-23
Setting Watch Conditions . . . . . . . 5-24
Using the WATCH Command . . . . 5-24
Displaying Active Watches. . . . . . . 5-25
Removing Watch Conditions . . . . . . 5-26
Example of Setting a Watch Condition. . . . 5-26
Stepping Through the Program Object . . . . 5-27
Stepping Over Call Statements . . . . . 5-29
Stepping Into Call Statements. . . . . . 5-29
Contents v
Example of Stepping Into an OPM
Program Using F22 . . . . . . . . 5-30
Example of Stepping Into a Subprocedure 5-31
Displaying Data and Expressions . . . . . 5-32
Unexpected Results when Evaluating
Variables. . . . . . . . . . . . . 5-34
Displaying the Contents of an Array . . . 5-35
Displaying the Contents of a Table . . . . 5-35
Displaying Data Structures . . . . . . 5-36
Displaying Indicators . . . . . . . . 5-37
Displaying Fields as Hexadecimal Values 5-38
Displaying Fields in Character Format. . . 5-38
Displaying UCS-2 Data . . . . . . . . 5-38
Displaying Variable-Length Fields . . . . 5-39
Displaying Data Addressed by Pointers . . 5-39
Evaluating Based Variables . . . . . . 5-40
Displaying Null-Capable Fields . . . . . 5-41
Using Debug Built-In Functions . . . . . 5-41
Debugging an XML-SAX Handling
Procedure . . . . . . . . . . . . 5-43
Changing the Value of Fields . . . . . . . 5-43
Displaying Attributes of a Field . . . . . . 5-45
Equating a Name with a Field, Expression, or
Command . . . . . . . . . . . . . 5-46
Source Debug National Language Support for
ILE RPG. . . . . . . . . . . . . . 5-47
Sample Source for Debug Examples . . . . 5-47
Handling Exceptions. . . . . . . . . . . 5-51
Exception Handling Overview . . . . . . 5-52
ILE RPG Exception Handling. . . . . . 5-54
Exception Handling within a Cycle-Main
Procedure . . . . . . . . . . . 5-54
Exception Handling within
Subprocedures. . . . . . . . . . 5-55
Differences between OPM and ILE RPG
Exception Handling . . . . . . . . 5-56
Using Exception Handlers . . . . . . . . 5-56
Exception Handler Priority . . . . . . 5-56
Nested Exceptions . . . . . . . . . 5-57
Unhandled Exceptions . . . . . . . . 5-57
Example of Unhandled Escape Message 5-57
Example of Unhandled Function Check 5-58
Optimization Considerations . . . . . . 5-59
Using RPG-Specific Handlers . . . . . . . 5-60
Specifying Error Indicators or the 'E'
Operation Code Extender . . . . . . . 5-60
Using a MONITOR Group. . . . . . . 5-61
Using an Error Subroutine. . . . . . . 5-62
Using a File Error (INFSR) Subroutine 5-63
Using a Program Error Subroutine . . . 5-65
Avoiding a Loop in an Error Subroutine 5-68
Specifying a Return Point in the ENDSR
Operation . . . . . . . . . . . . 5-70
ILE Condition Handlers . . . . . . . . 5-70
Using a Condition Handler . . . . . . 5-71
Using Cancel Handlers . . . . . . . . . 5-77
Problems when ILE CL Monitors for Notify
and Status Messages. . . . . . . . . . 5-80
Obtaining a Dump . . . . . . . . . . . 5-82
Obtaining an ILE RPG Formatted Dump . . . 5-82
Using the DUMP Operation Code . . . . . 5-82
Example of a Formatted Dump . . . . . . 5-83
Working with Files and Devices. . . . 6-1
Defining Files . . . . . . . . . . . . . 6-1
Associating Files with Input/Output Devices . . 6-1
Naming Files . . . . . . . . . . . . 6-3
Types of File Descriptions . . . . . . . . 6-3
Using Files with External-Description as
Program-Described . . . . . . . . . 6-4
Example of Some Typical Relationships
between Programs and Files . . . . . . 6-4
Defining Externally Described Files . . . . . 6-5
Renaming Record-Format Names . . . . . 6-5
Renaming Field Names . . . . . . . . 6-6
Ignoring Record Formats . . . . . . . 6-6
Using Input Specifications to Modify an
External Description . . . . . . . . . 6-7
Using Output Specifications . . . . . . 6-8
Level Checking . . . . . . . . . . . 6-9
Defining Program-Described Files . . . . . 6-10
Data Management Operations and ILE RPG
I/O Operations . . . . . . . . . . . 6-10
General File Considerations . . . . . . . . 6-11
Overriding and Redirecting File Input and
Output . . . . . . . . . . . . . . 6-12
Example of Redirecting File Input and
Output . . . . . . . . . . . . . 6-13
File Locking . . . . . . . . . . . . 6-13
Record Locking . . . . . . . . . . . 6-14
Sharing an Open Data Path . . . . . . . 6-15
Spooling. . . . . . . . . . . . . . 6-16
Output Spooling . . . . . . . . . . 6-17
SRTSEQ/ALTSEQ in an RPG Program versus a
DDS File. . . . . . . . . . . . . . 6-17
Accessing Database Files . . . . . . . . . 6-17
Database Files . . . . . . . . . . . . 6-18
Physical Files and Logical Files . . . . . 6-18
Data Files and Source Files . . . . . . 6-18
Using Externally Described Disk Files . . . . 6-18
Record Format Specifications . . . . . . 6-18
Access Path. . . . . . . . . . . . 6-19
Valid Keys for a Record or File . . . . . 6-21
Valid Search Arguments . . . . . . 6-21
Referring to a Partial Key . . . . . . 6-22
Record Blocking and Unblocking . . . . 6-23
Using Program-Described Disk Files . . . . 6-24
Indexed File . . . . . . . . . . . 6-24
Valid Search Arguments . . . . . . 6-24
Sequential File. . . . . . . . . . . 6-26
Record Address File . . . . . . . . . 6-26
Limits Records. . . . . . . . . . 6-26
Relative Record Numbers . . . . . . 6-27
Methods for Processing Disk Files . . . . . 6-27
Consecutive Processing . . . . . . . . 6-28
Sequential-by-Key Processing. . . . . . 6-28
Examples of Sequential-by-Key
Processing . . . . . . . . . . . 6-29
Random-by-Key Processing . . . . . . 6-34
Example of Random-by-Key Processing 6-35
Sequential-within-Limits Processing . . . 6-36
vi IBM i: ILE RPG Programmer's Guide
Examples of Sequential-within-Limits
Processing . . . . . . . . . . . 6-37
Relative-Record-Number Processing . . . 6-38
Valid File Operations . . . . . . . . . 6-39
Using Commitment Control . . . . . . . 6-41
Starting and Ending Commitment Control 6-42
Commitment Control Locks . . . . . 6-42
Commitment Control Scoping . . . . 6-43
Specifying Files for Commitment Control 6-43
Using the COMMIT Operation . . . . . 6-43
Example of Using Commitment Control 6-44
Specifying Conditional Commitment Control 6-45
Commitment Control in the Program Cycle 6-45
Unexpected Results Using Keyed Files. . . . 6-46
DDM Files . . . . . . . . . . . . . 6-46
Using Pre-V3R1 DDM Files . . . . . . 6-46
Accessing Externally Attached Devices . . . . 6-47
Types of Device Files . . . . . . . . . 6-47
Accessing Printer Devices . . . . . . . . 6-48
Specifying PRINTER Files . . . . . . . 6-48
Handling Page Overflow . . . . . . . 6-48
Using Overflow Indicators in
Program-Described Files . . . . . . 6-49
Example of Printing Headings on Every
Page . . . . . . . . . . . . . 6-50
Example of Printing a Field on Every
Page . . . . . . . . . . . . . 6-51
Using the Fetch-Overflow Routine in
Program-Described Files . . . . . . . 6-51
Specifying Fetch Overflow. . . . . . 6-53
Example of Specifying Fetch Overflow 6-53
Changing Forms Control Information in a
Program-Described File. . . . . . . . 6-53
Example of Changing Forms Control
Information. . . . . . . . . . . 6-54
Accessing Tape Devices. . . . . . . . . 6-55
Accessing Display Devices. . . . . . . . 6-55
Using Sequential Files . . . . . . . . . 6-56
Specifying a Sequential File . . . . . . 6-56
Example of Specifying a Sequential File 6-56
Using SPECIAL Files . . . . . . . . . 6-56
Example of Using a Special File . . . . . 6-58
Using WORKSTN Files . . . . . . . . . . 6-59
Intersystem Communications Function. . . . 6-60
Using Externally Described WORKSTN Files 6-60
Specifying Function Key Indicators on
Display Device Files . . . . . . . . . 6-62
Specifying Command Keys on Display
Device Files. . . . . . . . . . . . 6-62
Processing an Externally Described
WORKSTN File . . . . . . . . . . 6-62
Using Subfiles . . . . . . . . . . . 6-63
Use of Subfiles. . . . . . . . . . 6-65
Using Program-Described WORKSTN Files 6-66
Using a Program-Described WORKSTN File
with a Format Name . . . . . . . . 6-67
Output Specifications . . . . . . . 6-67
Input Specifications . . . . . . . . 6-67
Calculation Specifications . . . . . . 6-67
Additional Considerations . . . . . . 6-68
Using a Program-Described WORKSTN File
without a Format Name . . . . . . . 6-68
Input File . . . . . . . . . . . 6-68
Output File . . . . . . . . . . . 6-68
Combined File. . . . . . . . . . 6-68
Valid WORKSTN File Operations . . . . . 6-68
EXFMT Operation . . . . . . . . . 6-69
READ Operation . . . . . . . . . . 6-69
WRITE Operation. . . . . . . . . . 6-69
Multiple-Device Files . . . . . . . . . 6-69
Example of an Interactive Application . . . . . 6-71
Database Physical File . . . . . . . . . 6-71
Main Menu Inquiry . . . . . . . . . . 6-72
MAINMENU: DDS for a Display Device File 6-72
CUSMAIN: RPG Source . . . . . . . 6-74
File Maintenance . . . . . . . . . . . 6-75
CUSMSTL1: DDS for a Logical File . . . . 6-75
MNTMENU: DDS for a Display Device File 6-76
CUSMNT: RPG Source . . . . . . . . 6-78
Search by Zip Code . . . . . . . . . . 6-85
CUSMSTL2: DDS for a Logical File . . . . 6-86
SCHZIPD: DDS for a Display Device File 6-87
SCHZIP: RPG Source . . . . . . . . 6-89
Search and Inquiry by Name . . . . . . . 6-93
CUSMSTL3: DDS for a Logical File . . . . 6-93
SCHNAMD: DDS for a Display Device File 6-94
SCHNAM: RPG Source . . . . . . . . 6-96
Appendixes . . . . . . . . . . . . 7-1
Appendix A. Behavioral Differences Between OPM
RPG/400 and ILE RPG for AS/400 . . . . . . 7-1
Compiling . . . . . . . . . . . . . 7-1
Running . . . . . . . . . . . . . . 7-1
Debugging and Exception Handling . . . . . 7-2
I/O. . . . . . . . . . . . . . . . 7-3
DBCS Data in Character Fields. . . . . . . 7-5
Appendix B. Using the RPG III to RPG IV
Conversion Aid. . . . . . . . . . . . . 7-5
Conversion Overview. . . . . . . . . . 7-5
File Considerations . . . . . . . . . 7-6
Source Member Types . . . . . . . 7-6
File Record Length. . . . . . . . . 7-6
File and Member Names. . . . . . . 7-7
The Log File . . . . . . . . . . . . 7-7
Conversion Aid Tool Requirements . . . . 7-7
What the Conversion Aid Won't Do . . . . 7-8
Converting Your Source . . . . . . . . . 7-8
The CVTRPGSRC Command . . . . . . 7-9
Converting a Member Using the Defaults 7-13
Converting All Members in a File . . . . 7-13
Converting Some Members in a File . . . 7-13
Performing a Trial Conversion . . . . . 7-14
Obtaining Conversion Reports . . . . . 7-14
Converting Auto Report Source Members 7-14
Converting Source Members with
Embedded SQL . . . . . . . . . . 7-15
Inserting Specification Templates . . . . 7-15
Converting Source from a Data File. . . . 7-15
Example of Source Conversion . . . . . . 7-15
Analyzing Your Conversion . . . . . . . 7-18
Using the Conversion Report . . . . . . 7-18
Contents vii
Using the Log File . . . . . . . . . 7-20
Resolving Conversion Problems . . . . . . 7-22
Compilation Errors in Existing RPG III Code 7-23
Unsupported RPG III Features . . . . . 7-23
Converting the FREE operation code . . 7-23
Use of the /COPY Compiler Directive . . . 7-24
Merging Problems . . . . . . . . 7-24
Context-Sensitive Problems . . . . . 7-26
Use of Externally Described Data Structures 7-27
Merging an Array with an Externally
Described DS Subfield . . . . . . . 7-27
Renaming and Initializing an Externally
Described DS Subfield . . . . . . . 7-28
Run-time Differences . . . . . . . . 7-28
Appendix C. The Create Commands . . . . . 7-29
Using CL Commands . . . . . . . . . 7-29
How to Interpret Syntax Diagrams . . . . 7-29
CRTBNDRPG Command . . . . . . . . 7-30
Description of the CRTBNDRPG Command 7-33
CRTRPGMOD Command . . . . . . . . 7-47
Description of the CRTRPGMOD command 7-50
Appendix D. Compiler Listings . . . . . . . 7-50
Reading a Compiler Listing . . . . . . . 7-52
Prologue. . . . . . . . . . . . . 7-52
Source Section . . . . . . . . . . . 7-53
Additional Diagnostic Messages . . . . . 7-58
Output Buffer Positions. . . . . . . . 7-58
/COPY Member Table . . . . . . . . 7-59
Compile-Time Data . . . . . . . . . 7-59
Key Field Information . . . . . . . . 7-60
Cross-Reference Table . . . . . . . . 7-61
EVAL-CORR Summary . . . . . . . . 7-62
External References List . . . . . . . 7-63
Message Summary . . . . . . . . . 7-64
Final Summary . . . . . . . . . . 7-64
Code Generation and Binding Errors . . . 7-65
Appendix E. Information for Preprocessor
Providers . . . . . . . . . . . . . . 7-65
Bibliography . . . . . . . . . . . . 8-1
Notices . . . . . . . . . . . . . . A-1
Programming interface information . . . . . . A-3
Trademarks . . . . . . . . . . . . . . A-3
Terms and conditions . . . . . . . . . . A-3
Index . . . . . . . . . . . . . . . X-1
viii IBM i: ILE RPG Programmer's Guide
ILE RPG Programmer's Guide

标签: IBM 400 指导 00 编程

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警