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/

CONTENTS Table of Contents


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       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       Interacting with the System 
1.1.7         AS/400 Tools       Application Development ToolSet for AS/400       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       Method       Example of OPM-Compatible Program       Related Information 
1.3.2         Strategy 2:  ILE Program Using CRTBNDRPG       Method       Example of ILE Program Using CRTBNDRPG       Related Information 
1.3.3         Strategy 3:  ILE Application Using CRTRPGMOD       Method       Single-Language ILE Application Scenario       Mixed-Language ILE Application Scenario       Advanced Application Scenario       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       Main Procedures and Subprocedures       Prototyped Calls 
1.4.2         Example of Module with Multiple Procedures       The Entire ARRSRPT Program 
1.4.3         Coding Considerations       General Considerations       Program Creation       Main Procedure Considerations       Subprocedure Considerations 
1.4.4         For Further Information       Main Procedures       Subprocedures       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       Creating a Program for Source Debugging       Creating a Program with Static Binding       Creating an OPM-Compatible Program Object 
2.2.2         Using a Compiler Listing       Obtaining a Compiler Listing       Customizing a Compiler Listing       Correcting Compilation Errors       Correcting Run-time Errors       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       Using the CRTRPGMOD Command       Creating a Module for Source Debugging       Additional Examples       Behavior of Bound ILE RPG Modules       Related CL Commands 
2.3.2         Binding Modules into a Program       Using the CRTPGM Command       Additional Examples       Related CL Commands 
2.3.3         Using a Binder Listing 
2.3.4         Changing a Module or Program       Using the UPDPGM Command       Changing the Optimization Level       Removing Observability       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       Changing A Service Program       Related CL commands 
2.4.4         Sample Service Program       Creating the Service Program       Binding to a Program       Updating the Service Program       Sample Binder Listing 

2.5           Chapter 9.  Running a Program 
2.5.1         Running a Program Using the CL CALL Command       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       Specifying an Activation Group       Running in the OPM Default Activation Group       Maintaining OPM RPG/400 and ILE RPG Program Compatibility       Deleting an Activation Group       Reclaim Resources Command 
2.5.7         Managing Dynamically-Allocated Storage       Managing the Default Heap Using RPG Operations       Heap Storage Problems       Managing Your Own Heap Using ILE Bindable APIs 

2.6           Chapter 10.  Calling Programs and Procedures 
2.6.1         Program/Procedure Call Overview       Calling Programs       Calling Procedures       The Call Stack       Recursive Calls       Parameter-Passing Considerations 
2.6.2         Using a Prototyped Call       Using the CALLP Operation       Calling within an Expression       Examples of Free-Form Call 
2.6.3         Passing Prototyped Parameters       Parameter Passing Styles       Using Operational Descriptors       Omitting Parameters       Checking for the Number of Passed Parameters       Passing Less Data Than Required       Order of Evaluation       Interlanguage Calls 
2.6.4         Interlanguage Calling Considerations 
2.6.5         Using the Fixed-Form Call Operations       Examples of CALL and CALLB       Passing Parameters Using PARM and PLIST 
2.6.6         Returning from a Called Program or Procedure       Returning from a Main Procedure       Returning from a Subprocedure       Returning using ILE Bindable APIs 
2.6.7         Using Bindable APIs       Examples of Using Bindable APIs 
2.6.8         Calling a Graphics Routine 
2.6.9         Calling Special Routines 
2.6.10        Multithreading Considerations      How to Share Data Across More Than One Module      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       Debug Commands 
3.1.2         Preparing a Program for Debugging       Creating a Root Source View       Creating a COPY Source View       Creating a Listing View       Creating a Statement View 
3.1.3         Starting the ILE Source Debugger       STRDBG Example       Setting Debug Options 
3.1.4         Adding/Removing Programs from a Debug Session       Example of Adding a Service Program to a Debug Session       Example of Removing ILE Programs from a Debug Session 
3.1.5         Viewing the Program Source       Viewing a Different Module       Changing the View of a Module 
3.1.6         Setting and Removing Breakpoints       Setting and Removing Unconditional Job Breakpoints       Setting and Removing Unconditional Thread Breakpoints       Setting and Removing Conditional Job Breakpoints       National Language Sort Sequence (NLSS)       Setting and Removing Job Breakpoints Using Statement Numbers       Setting and Removing Conditional Thread Breakpoints       Removing All Job and Thread Breakpoints 
3.1.7         Setting and Removing Watch Conditions       Characteristics of Watches       Setting Watch Conditions       Displaying Active Watches       Removing Watch Conditions 
3.1.8         Example of Setting a Watch Condition 
3.1.9         Stepping Through the Program Object       Stepping Over Call Statements       Stepping Into Call Statements       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       ILE RPG Exception Handling 
3.2.2         Using Exception Handlers       Exception Handler Priority       Nested Exceptions       Unhandled Exceptions       Optimization Considerations 
3.2.3         Using RPG-Specific Handlers       Specifying Error Indicators or the 'E' Operation Code Extender       Using an Error Subroutine       Specifying a Return Point in the ENDSR Operation 
3.2.4         ILE Condition Handlers       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       Using Files with External-Description as Program-Described       Example of Some Typical Relationships between Programs and Files 
4.1.4         Defining Externally Described Files       Renaming Record-Format Names       Renaming Field Names       Ignoring Record Formats       Using Input Specifications to Modify an External Description       Using Output Specifications       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       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       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       Physical Files and Logical Files       Data Files and Source Files 
4.3.2         Using Externally Described Disk Files       Record Format Specifications       Access Path       Valid Keys for a Record or File       Record Blocking and Unblocking 
4.3.3         Using Program-Described Disk Files       Indexed File       Sequential File       Record Address File 
4.3.4         Methods for Processing Disk Files       Consecutive Processing       Sequential-by-Key Processing       Random-by-Key Processing       Sequential-within-Limits Processing       Relative-Record-Number Processing 
4.3.5         Valid File Operations 
4.3.6         Using Commitment Control       Starting and Ending Commitment Control       Specifying Files for Commitment Control       Using the COMMIT Operation       Specifying Conditional Commitment Control       Commitment Control in the Program Cycle 
4.3.7         DDM Files       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       Specifying PRINTER Files       Handling Page Overflow       Using the Fetch-Overflow Routine in Program-Described Files       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       Specifying a Sequential File 
4.4.6         Using SPECIAL Files       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       Specifying Function Key Indicators on Display Device Files       Specifying Command Keys on Display Device Files       Processing an Externally Described WORKSTN File       Using Subfiles 
4.5.3         Using Program-Described WORKSTN Files       Using a Program-Described WORKSTN File with a Format Name       Using a Program-Described WORKSTN File without a Format Name 
4.5.4         Valid WORKSTN File Operations       EXFMT Operation       READ Operation       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       MAINMENU:  DDS for a Display Device File       CUSMAIN:  RPG Source 
4.6.3         File Maintenance       CUSMSTL1:  DDS for a Logical File       MNTMENU:  DDS for a Display Device File       CUSMNT:  RPG Source 
4.6.4         Search by Zip Code       CUSMSTL2:  DDS for a Logical File       SZIPMENU:  DDS for a Display Device File       SCHZIP:  RPG Source 
4.6.5         Search and Inquiry by Name       CUSMSTL3:  DDS for a Logical File       SNAMMENU:  DDS for a Display Device File       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.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.1 Description of the CRTBNDRPG 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.