rpg ile concepts

Download RPG ILE Concepts

Post on 11-Nov-2014

81 views

Category:

Documents

5 download

Embed Size (px)

DESCRIPTION

IBM ILE RPG

TRANSCRIPT

System i

ILE ConceptsVersion 6 Release 1SC41-5606-08

System i

ILE ConceptsVersion 6 Release 1SC41-5606-08

Note Before using this information and the product it supports, be sure to read the information in Appendix D, Notices, on page 185.

This edition applies to version 6, release 1, modification 0 of IBM i5/OS (product number 5761-SS1) and to all subsequent releases and modifications until otherwise indicated in new editions. This version does not run on all reduced instruction set computer (RISC) models nor does it run on CISC models. Copyright International Business Machines Corporation 1997, 2008. All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

ContentsAbout ILE Concepts (SC41-5606) . . . . . . . . . . . . . . . . . . . . . . . . . xiWho should read this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Prerequisite and related information . . . . . . . . . . . . . . . . . . . . . . . . . . . xi How to send your comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii

|

Summary of Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii Chapter 1. Integrated Language Environment Introduction . . . . . . . . . . . . . . 1What Is ILE? . . . . . . . . . . . . . . . . What Are the Benefits of ILE? . . . . . . . . . . Binding . . . . . . . . . . . . . . . . . Modularity . . . . . . . . . . . . . . . . Reusable Components . . . . . . . . . . . . Common Runtime Services . . . . . . . . . . Coexistence with Existing Applications . . . . . . Source Debugger . . . . . . . . . . . . . . Better Control over Resources. . . . . . . . . . Shared Open Data PathScenario . . . . . . . Commitment ControlScenario . . . . . . . . Better Control over Language Interactions . . . . . Mixed LanguagesScenario . . . . . . . . . Better Code Optimization . . . . . . . . . . . Better Environment for C . . . . . . . . . . . What Is the History of ILE? . . . . . . . . . . . Original Program Model Description . . . . . . . Principal Characteristics of OPM. . . . . . . . Extended Program Model Description . . . . . . . Integrated Language Environment Description . . . . Principal Characteristics of Procedure-Based Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1 1 2 2 2 2 3 3 4 4 4 5 5 6 6 7 7 7 8

Chapter 2. ILE Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . 9Structure of an ILE Program . . Procedure . . . . . . . . Module Object . . . . . . ILE Program . . . . . . . Service Program . . . . . . Binding Directory . . . . . Binding Directory Processing Binder Functions . . . . . Calling a Program or a Procedure Dynamic Program Calls . . Static Procedure Calls . . . Activation . . . . . . . . Error Handling Overview . . Optimizing Translator . . . . Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 . 9 . 10 . 11 . 13 . 15 . 16 . 16 . 18 . 18 . 18 . 19 . 20 . 22 . 22

Chapter 3. ILE Advanced Concepts . . . . . . . . . . . . . . . . . . . . . . . 23Program Activation . . . . . Program Activation Creation Activation Group . . . . . Activation Group Creation . Default Activation Groups . ILE Activation Group Deletion Copyright IBM Corp. 1997, 2008

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

23 24 24 26 27 28

iii

Service Program Activation . . . . . . . . . . . . Control Boundaries . . . . . . . . . . . . . . . Control Boundaries for ILE Activation Groups . . . . . Control Boundaries for the OPM Default Activation Group Control Boundary Use . . . . . . . . . . . . . Error Handling . . . . . . . . . . . . . . . . Job Message Queues . . . . . . . . . . . . . Exception Messages and How They Are Sent . . . . . How Exception Messages Are Handled . . . . . . . Exception Recovery . . . . . . . . . . . . . . Default Actions for Unhandled Exceptions . . . . . . Types of Exception Handlers . . . . . . . . . . ILE Conditions . . . . . . . . . . . . . . . Data Management Scoping Rules . . . . . . . . . . Call-Level Scoping . . . . . . . . . . . . . . Activation-Group-Level Scoping . . . . . . . . . Job-Level Scoping . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

30 32 32 33 34 34 35 35 36 36 37 38 40 41 41 42 43

Chapter 4. Teraspace and Single-Level Storage . . . . . . . . . . . . . . . . . . 45Teraspace Characteristics . . . . . . . . . . . . . . . . . . Using Teraspace for Storage . . . . . . . . . . . . . . . . . Choosing a Program Storage Model . . . . . . . . . . . . . . Specifying the Teraspace Storage Model . . . . . . . . . . . . Selecting a Compatible Activation Group . . . . . . . . . . . How the Storage Models Interact . . . . . . . . . . . . . . Rules for Binding Modules . . . . . . . . . . . . . . . Rules for Binding to Service Programs . . . . . . . . . . . Rules for Activating Programs and Service Programs . . . . . . Rules for Program and Procedure Calls . . . . . . . . . . . Converting Your Program or Service Program to Inherit a Storage Model . Updating Your Programs: Teraspace Considerations . . . . . . . . Taking Advantage of 8-byte Pointers in Your C and C++ Code . . . . . Pointer Support in C and C++ Compilers . . . . . . . . . . . Pointer Conversions . . . . . . . . . . . . . . . . . . Using the Teraspace Storage Model . . . . . . . . . . . . . . Using Teraspace: Best Practices . . . . . . . . . . . . . . . System Controls over Teraspace Programs When They are Created . . System Controls over Teraspace Programs When They are Activated . i5/OS Interfaces and Teraspace . . . . . . . . . . . . . . . Potential Problems that Can Arise When You Use Teraspace . . . . . Teraspace Usage Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 45 46 46 47 47 48 48 48 48 48 49 49 50 50 51 51 51 51 52 52 53

Chapter 5. Program Creation Concepts . . . . . . . . . . . . . . . . . . . . . . 55Create Program and Create Service Program Commands . . . . . . . . Use Adopted Authority (QUSEADPAUT) . . . . . . . . . . . . Using optimization parameters . . . . . . . . . . . . . . . . Stored data in modules and programs . . . . . . . . . . . . . . Symbol Resolution . . . . . . . . . . . . . . . . . . . . . Resolved and Unresolved Imports . . . . . . . . . . . . . . . Binding by Copy . . . . . . . . . . . . . . . . . . . . Binding by Reference . . . . . . . . . . . . . . . . . . . Binding Large Numbers of Modules . . . . . . . . . . . . . . Importance of the Order of Exports . . . . . . . . . . . . . . Program Creation Example 1 . . . . . . . . . . . . . . . Program Cr

Recommended

View more >