Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp
Title: ILE RPG for AS/400 Programmer's Guide
Document Number: SC09-2507-02
Build Date: 03/17/99 10:43:40 Build Version: 1.3.0
Document Path: /home/webapps/epubs/htdocs/book/qb3agy03.boo

CONTENTS Table of Contents




Summarize

COVER         Book Cover 

NOTICES       Notices 

EDITION       Edition Notice 

CONTENTS      Table of Contents 

FRONT_1       Notices 
FRONT_1.1     Programming Interface Information 
FRONT_1.2     Trademarks and Service Marks 

FRONT_2       About This Guide 
FRONT_2.1     Who Should Use This Guide 
FRONT_2.2     Prerequisite and Related Information 
FRONT_2.3     How to Send Your Comments 
FRONT_2.4     What's New This Release? 
  FRONT_2.4.1   Changes to this Guide Since V4R2 

1.0           ILE RPG Introduction 

1.1           Chapter 1.  Overview of the RPG IV Programming Language 
1.1.1         RPG IV Specifications 
1.1.2         Cycle Programming 
  1.1.2.1       Subprocedure logic 
1.1.3         Indicators 
1.1.4         Operation Codes 
1.1.5         Example of an ILE RPG Program 
1.1.6         Using the OS/400 System 
  1.1.6.1       Interacting with the System 
1.1.7         AS/400 Tools 
  1.1.7.1       Application Development ToolSet for AS/400 
  1.1.7.2       IBM VisualAge RPG and Cooperative Development Environment for AS/400 

1.2           Chapter 2.  RPG Programming in ILE 
1.2.1         Program Creation 
1.2.2         Program Management 
1.2.3         Program Call 
1.2.4         Source Debugging 
1.2.5         Bindable APIs 
1.2.6         Multithreaded Applications 

1.3           Chapter 3.  Program Creation Strategies 
1.3.1         Strategy 1:  OPM-Compatible Application 
  1.3.1.1       Method 
  1.3.1.2       Example of OPM-Compatible Program 
  1.3.1.3       Related Information 
1.3.2         Strategy 2:  ILE Program Using CRTBNDRPG 
  1.3.2.1       Method 
  1.3.2.2       Example of ILE Program Using CRTBNDRPG 
  1.3.2.3       Related Information 
1.3.3         Strategy 3:  ILE Application Using CRTRPGMOD 
  1.3.3.1       Method 
  1.3.3.2       Single-Language ILE Application Scenario 
  1.3.3.3       Mixed-Language ILE Application Scenario 
  1.3.3.4       Advanced Application Scenario 
  1.3.3.5       Related Information 
1.3.4         A Strategy to Avoid 

1.4           Chapter 4.  Creating an Application Using Multiple Procedures 
1.4.1         A Multiple Procedures Module -- Overview 
  1.4.1.1       Main Procedures and Subprocedures 
  1.4.1.2       Prototyped Calls 
1.4.2         Example of Module with Multiple Procedures 
  1.4.2.1       The Entire ARRSRPT Program 
1.4.3         Coding Considerations 
  1.4.3.1       General Considerations 
  1.4.3.2       Program Creation 
  1.4.3.3       Main Procedure Considerations 
  1.4.3.4       Subprocedure Considerations 
1.4.4         For Further Information 
  1.4.4.1       Main Procedures 
  1.4.4.2       Subprocedures 
  1.4.4.3       Prototyped Call 

2.0           Creating and Running an ILE RPG Application 

2.1           Chapter 5.  Entering Source Statements 
2.1.1         Creating a Library and Source Physical File 
2.1.2         Using the Source Entry Utility (SEU) 
2.1.3         Using SQL Statements 

2.2           Chapter 6.  Creating a Program with the CRTBNDRPG Command 
2.2.1         Using the CRTBNDRPG Command 
  2.2.1.1       Creating a Program for Source Debugging 
  2.2.1.2       Creating a Program with Static Binding 
  2.2.1.3       Creating an OPM-Compatible Program Object 
2.2.2         Using a Compiler Listing 
  2.2.2.1       Obtaining a Compiler Listing 
  2.2.2.2       Customizing a Compiler Listing 
  2.2.2.3       Correcting Compilation Errors 
  2.2.2.4       Correcting Run-time Errors 
  2.2.2.5       Using a Compiler Listing for Maintenance 
2.2.3         Accessing the RETURNCODE Data Area 

2.3           Chapter 7.  Creating a Program with the CRTRPGMOD and CRTPGM Commands 
2.3.1         Creating a Module Object 
  2.3.1.1       Using the CRTRPGMOD Command 
  2.3.1.2       Creating a Module for Source Debugging 
  2.3.1.3       Additional Examples 
  2.3.1.4       Behavior of Bound ILE RPG Modules 
  2.3.1.5       Related CL Commands 
2.3.2         Binding Modules into a Program 
  2.3.2.1       Using the CRTPGM Command 
  2.3.2.2       Additional Examples 
  2.3.2.3       Related CL Commands 
2.3.3         Using a Binder Listing 
2.3.4         Changing a Module or Program 
  2.3.4.1       Using the UPDPGM Command 
  2.3.4.2       Changing the Optimization Level 
  2.3.4.3       Removing Observability 
  2.3.4.4       Reducing an Object's Size 

2.4           Chapter 8.  Creating a Service Program 
2.4.1         Service Program Overview 
2.4.2         Strategies for Creating Service Programs 
2.4.3         Creating a Service Program Using CRTSRVPGM 
  2.4.3.1       Changing A Service Program 
  2.4.3.2       Related CL commands 
2.4.4         Sample Service Program 
  2.4.4.1       Creating the Service Program 
  2.4.4.2       Binding to a Program 
  2.4.4.3       Updating the Service Program 
  2.4.4.4       Sample Binder Listing 

2.5           Chapter 9.  Running a Program 
2.5.1         Running a Program Using the CL CALL Command 
  2.5.1.1       Passing Parameters using the CL CALL Command 
2.5.2         Running a Program From a Menu-Driven Application 
2.5.3         Running a Program Using a User-Created Command 
2.5.4         Replying to Run-Time Inquiry Messages 
2.5.5         Ending an ILE Program 
2.5.6         Managing Activation Groups 
  2.5.6.1       Specifying an Activation Group 
  2.5.6.2       Running in the OPM Default Activation Group 
  2.5.6.3       Maintaining OPM RPG/400 and ILE RPG Program Compatibility 
  2.5.6.4       Deleting an Activation Group 
  2.5.6.5       Reclaim Resources Command 
2.5.7         Managing Dynamically-Allocated Storage 
  2.5.7.1       Managing the Default Heap Using RPG Operations 
  2.5.7.2       Heap Storage Problems 
  2.5.7.3       Managing Your Own Heap Using ILE Bindable APIs 

2.6           Chapter 10.  Calling Programs and Procedures 
2.6.1         Program/Procedure Call Overview 
  2.6.1.1       Calling Programs 
  2.6.1.2       Calling Procedures 
  2.6.1.3       The Call Stack 
  2.6.1.4       Recursive Calls 
  2.6.1.5       Parameter-Passing Considerations 
2.6.2         Using a Prototyped Call 
  2.6.2.1       Using the CALLP Operation 
  2.6.2.2       Calling within an Expression 
  2.6.2.3       Examples of Free-Form Call 
2.6.3         Passing Prototyped Parameters 
  2.6.3.1       Parameter Passing Styles 
  2.6.3.2       Using Operational Descriptors 
  2.6.3.3       Omitting Parameters 
  2.6.3.4       Checking for the Number of Passed Parameters 
  2.6.3.5       Passing Less Data Than Required 
  2.6.3.6       Order of Evaluation 
  2.6.3.7       Interlanguage Calls 
2.6.4         Interlanguage Calling Considerations 
2.6.5         Using the Fixed-Form Call Operations 
  2.6.5.1       Examples of CALL and CALLB 
  2.6.5.2       Passing Parameters Using PARM and PLIST 
2.6.6         Returning from a Called Program or Procedure 
  2.6.6.1       Returning from a Main Procedure 
  2.6.6.2       Returning from a Subprocedure 
  2.6.6.3       Returning using ILE Bindable APIs 
2.6.7         Using Bindable APIs 
  2.6.7.1       Examples of Using Bindable APIs 
2.6.8         Calling a Graphics Routine 
2.6.9         Calling Special Routines 
2.6.10        Multithreading Considerations 
  2.6.10.1      How to Share Data Across More Than One Module 
  2.6.10.2      How to Avoid Deadlock Between Modules 

3.0           Debugging and Exception Handling 

3.1           Chapter 11.  Debugging Programs 
3.1.1         The ILE Source Debugger 
  3.1.1.1       Debug Commands 
3.1.2         Preparing a Program for Debugging 
  3.1.2.1       Creating a Root Source View 
  3.1.2.2       Creating a COPY Source View 
  3.1.2.3       Creating a Listing View 
  3.1.2.4       Creating a Statement View 
3.1.3         Starting the ILE Source Debugger 
  3.1.3.1       STRDBG Example 
  3.1.3.2       Setting Debug Options 
3.1.4         Adding/Removing Programs from a Debug Session 
  3.1.4.1       Example of Adding a Service Program to a Debug Session 
  3.1.4.2       Example of Removing ILE Programs from a Debug Session 
3.1.5         Viewing the Program Source 
  3.1.5.1       Viewing a Different Module 
  3.1.5.2       Changing the View of a Module 
3.1.6         Setting and Removing Breakpoints 
  3.1.6.1       Setting and Removing Unconditional Job Breakpoints 
  3.1.6.2       Setting and Removing Unconditional Thread Breakpoints 
  3.1.6.3       Setting and Removing Conditional Job Breakpoints 
  3.1.6.4       National Language Sort Sequence (NLSS) 
  3.1.6.5       Setting and Removing Job Breakpoints Using Statement Numbers 
  3.1.6.6       Setting and Removing Conditional Thread Breakpoints 
  3.1.6.7       Removing All Job and Thread Breakpoints 
3.1.7         Setting and Removing Watch Conditions 
  3.1.7.1       Characteristics of Watches 
  3.1.7.2       Setting Watch Conditions 
  3.1.7.3       Displaying Active Watches 
  3.1.7.4       Removing Watch Conditions 
3.1.8         Example of Setting a Watch Condition 
3.1.9         Stepping Through the Program Object 
  3.1.9.1       Stepping Over Call Statements 
  3.1.9.2       Stepping Into Call Statements 
  3.1.9.3       Displaying Data and Expressions 
3.1.10        Changing the Value of Fields 
3.1.11        Displaying Attributes of a Field 
3.1.12        Equating a Name with a Field, Expression, or Command 
3.1.13        Source Debug National Language Support for ILE RPG 
3.1.14        Sample Source for Debug Examples 

3.2           Chapter 12.  Handling Exceptions 
3.2.1         Exception Handling Overview 
  3.2.1.1       ILE RPG Exception Handling 
3.2.2         Using Exception Handlers 
  3.2.2.1       Exception Handler Priority 
  3.2.2.2       Nested Exceptions 
  3.2.2.3       Unhandled Exceptions 
  3.2.2.4       Optimization Considerations 
3.2.3         Using RPG-Specific Handlers 
  3.2.3.1       Specifying Error Indicators or the 'E' Operation Code Extender 
  3.2.3.2       Using an Error Subroutine 
  3.2.3.3       Specifying a Return Point in the ENDSR Operation 
3.2.4         ILE Condition Handlers 
  3.2.4.1       Using a Condition Handler 
3.2.5         Using Cancel Handlers 
3.2.6         Problems when ILE CL Monitors for Notify and Status Messages 

3.3           Chapter 13.  Obtaining a Dump 
3.3.1         Obtaining an ILE RPG Formatted Dump 
3.3.2         Using the DUMP Operation Code 
3.3.3         Example of a Formatted Dump 

4.0           Working with Files and Devices 

4.1           Chapter 14.  Defining Files 
4.1.1         Associating Files with Input/Output Devices 
4.1.2         Naming Files 
4.1.3         Types of File Descriptions 
  4.1.3.1       Using Files with External-Description as Program-Described 
  4.1.3.2       Example of Some Typical Relationships between Programs and Files 
4.1.4         Defining Externally Described Files 
  4.1.4.1       Renaming Record-Format Names 
  4.1.4.2       Renaming Field Names 
  4.1.4.3       Ignoring Record Formats 
  4.1.4.4       Using Input Specifications to Modify an External Description 
  4.1.4.5       Using Output Specifications 
  4.1.4.6       Level Checking 
4.1.5         Defining Program-Described Files 
4.1.6         Data Management Operations and ILE RPG I/O Operations 

4.2           Chapter 15.  General File Considerations 
4.2.1         Overriding and Redirecting File Input and Output 
  4.2.1.1       Example of Redirecting File Input and Output 
4.2.2         File Locking 
4.2.3         Record Locking 
4.2.4         Sharing an Open Data Path 
4.2.5         Spooling 
  4.2.5.1       Output Spooling 
4.2.6         SRTSEQ/ALTSEQ in an RPG Program versus a DDS File 

4.3           Chapter 16.  Accessing Database Files 
4.3.1         Database Files 
  4.3.1.1       Physical Files and Logical Files 
  4.3.1.2       Data Files and Source Files 
4.3.2         Using Externally Described Disk Files 
  4.3.2.1       Record Format Specifications 
  4.3.2.2       Access Path 
  4.3.2.3       Valid Keys for a Record or File 
  4.3.2.4       Record Blocking and Unblocking 
4.3.3         Using Program-Described Disk Files 
  4.3.3.1       Indexed File 
  4.3.3.2       Sequential File 
  4.3.3.3       Record Address File 
4.3.4         Methods for Processing Disk Files 
  4.3.4.1       Consecutive Processing 
  4.3.4.2       Sequential-by-Key Processing 
  4.3.4.3       Random-by-Key Processing 
  4.3.4.4       Sequential-within-Limits Processing 
  4.3.4.5       Relative-Record-Number Processing 
4.3.5         Valid File Operations 
4.3.6         Using Commitment Control 
  4.3.6.1       Starting and Ending Commitment Control 
  4.3.6.2       Specifying Files for Commitment Control 
  4.3.6.3       Using the COMMIT Operation 
  4.3.6.4       Specifying Conditional Commitment Control 
  4.3.6.5       Commitment Control in the Program Cycle 
4.3.7         DDM Files 
  4.3.7.1       Using Pre-V3R1 DDM Files 

4.4           Chapter 17.  Accessing Externally Attached Devices 
4.4.1         Types of Device Files 
4.4.2         Accessing Printer Devices 
  4.4.2.1       Specifying PRINTER Files 
  4.4.2.2       Handling Page Overflow 
  4.4.2.3       Using the Fetch-Overflow Routine in Program-Described Files 
  4.4.2.4       Changing Forms Control Information in a Program-Described File 
4.4.3         Accessing Tape Devices 
4.4.4         Accessing Display Devices 
4.4.5         Using Sequential Files 
  4.4.5.1       Specifying a Sequential File 
4.4.6         Using SPECIAL Files 
  4.4.6.1       Example of Using a Special File 

4.5           Chapter 18.  Using WORKSTN Files 
4.5.1         Intersystem Communications Function 
4.5.2         Using Externally Described WORKSTN Files 
  4.5.2.1       Specifying Function Key Indicators on Display Device Files 
  4.5.2.2       Specifying Command Keys on Display Device Files 
  4.5.2.3       Processing an Externally Described WORKSTN File 
  4.5.2.4       Using Subfiles 
4.5.3         Using Program-Described WORKSTN Files 
  4.5.3.1       Using a Program-Described WORKSTN File with a Format Name 
  4.5.3.2       Using a Program-Described WORKSTN File without a Format Name 
4.5.4         Valid WORKSTN File Operations 
  4.5.4.1       EXFMT Operation 
  4.5.4.2       READ Operation 
  4.5.4.3       WRITE Operation 
4.5.5         Multiple-Device Files 

4.6           Chapter 19.  Example of an Interactive Application 
4.6.1         Database Physical File 
4.6.2         Main Menu Inquiry 
  4.6.2.1       MAINMENU:  DDS for a Display Device File 
  4.6.2.2       CUSMAIN:  RPG Source 
4.6.3         File Maintenance 
  4.6.3.1       CUSMSTL1:  DDS for a Logical File 
  4.6.3.2       MNTMENU:  DDS for a Display Device File 
  4.6.3.3       CUSMNT:  RPG Source 
4.6.4         Search by Zip Code 
  4.6.4.1       CUSMSTL2:  DDS for a Logical File 
  4.6.4.2       SZIPMENU:  DDS for a Display Device File 
  4.6.4.3       SCHZIP:  RPG Source 
4.6.5         Search and Inquiry by Name 
  4.6.5.1       CUSMSTL3:  DDS for a Logical File 
  4.6.5.2       SNAMMENU:  DDS for a Display Device File 
  4.6.5.3       SCHNAM:  RPG Source 

APPENDIX1     Appendixes 

APPENDIX1.1   Appendix A.  Behavioral Differences Between OPM RPG/400 and ILE RPG for AS/400 
APPENDIX1.1.1 Compiling 
APPENDIX1.1.2 Running 
APPENDIX1.1.3 Debugging and Exception Handling 
APPENDIX1.1.4 I/O 
APPENDIX1.1.5 DBCS Data in Character Fields 

APPENDIX1.2   Appendix B.  Using the RPG III to RPG IV Conversion Aid 
APPENDIX1.2.1 Conversion Overview 
  APPENDIX1.2.1.1 File Considerations 
  APPENDIX1.2.1.2 The Log File 
  APPENDIX1.2.1.3 Conversion Aid Tool Requirements 
  APPENDIX1.2.1.4 What the Conversion Aid Won't Do 
APPENDIX1.2.2 Converting Your Source 
  APPENDIX1.2.2.1 The CVTRPGSRC Command 
  APPENDIX1.2.2.2 Converting a Member Using the Defaults 
  APPENDIX1.2.2.3 Converting All Members in a File 
  APPENDIX1.2.2.4 Converting Some Members in a File 
  APPENDIX1.2.2.5 Performing a Trial Conversion 
  APPENDIX1.2.2.6 Obtaining Conversion Reports 
  APPENDIX1.2.2.7 Converting Auto Report Source Members 
  APPENDIX1.2.2.8 Converting Source Members with Embedded SQL 
  APPENDIX1.2.2.9 Inserting Specification Templates 
  APPENDIX1.2.2.10 Converting Source from a Data File 
APPENDIX1.2.3 Example of Source Conversion 
APPENDIX1.2.4 Analyzing Your Conversion 
  APPENDIX1.2.4.1 Using the Conversion Report 
  APPENDIX1.2.4.2 Using the Log File 
APPENDIX1.2.5 Resolving Conversion Problems 
  APPENDIX1.2.5.1 Compilation Errors in Existing RPG III Code 
  APPENDIX1.2.5.2 Unsupported RPG III Features 
  APPENDIX1.2.5.3 Use of the /COPY Compiler Directive 
  APPENDIX1.2.5.4 Use of Externally Described Data Structures 
  APPENDIX1.2.5.5 Run-time Differences 

APPENDIX1.3   Appendix C.  The Create Commands 
APPENDIX1.3.1 Using CL Commands 
  APPENDIX1.3.1.1 How to Interpret Syntax Diagrams 
APPENDIX1.3.2 CRTBNDRPG Command 
  APPENDIX1.3.2.1 Description of the CRTBNDRPG Command 
APPENDIX1.3.3 CRTRPGMOD Command 
  APPENDIX1.3.3.1 Description of the CRTRPGMOD command 

APPENDIX1.4   Appendix D.  Compiler Listings 
APPENDIX1.4.1 Reading a Compiler Listing 
  APPENDIX1.4.1.1 Prologue 
  APPENDIX1.4.1.2 Source Section 
  APPENDIX1.4.1.3 Additional Diagnostic Messages 
  APPENDIX1.4.1.4 Output Buffer Positions 
  APPENDIX1.4.1.5 /COPY Member Table 
  APPENDIX1.4.1.6 Compile-Time Data 
  APPENDIX1.4.1.7 Key Field Information 
  APPENDIX1.4.1.8 Cross-Reference Table 
  APPENDIX1.4.1.9 External References List 
  APPENDIX1.4.1.10 Message Summary 
  APPENDIX1.4.1.11 Final Summary 
  APPENDIX1.4.1.12 Code Generation and Binding Errors 

BIBLIOGRAPHY  Bibliography 

INDEX         Index 


Previous Topic Next Topic Copyright IBM Corp. 1994, 1999

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.