IBM AS/400 Manuale Utente

Navigare online o scaricare Manuale Utente per Software IBM AS/400. IBM AS/400 User's Manual Manuale Utente

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 489
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 0
AS/400e ÉÂÔ
ILE RPG for AS/400
Programmer's Guide
Version 4
SC09-2507-02
Vedere la pagina 0
1 2 3 4 5 6 ... 488 489

Sommario

Pagina 1 - Programmer's Guide

AS/400e ÉÂÔ ILE RPG for AS/400Programmer's GuideVersion 4 SC09-2507-02

Pagina 2

SRTSEQ/ALTSEQ in an RPG Program versus a DDS File ... 279Chapter 16. Accessing Database Files ... 281Database Files . .

Pagina 3

Creating a Module Object You bind a module containing NOMAIN to another module using one of thefollowing commands: a. CRTPGM command b. CRTSRVPGM

Pagina 4 - Third Edition (May 1999)

Creating a Module Object *------------------------------------------------------------------* Subprocedure Trans_Inc *--------------------------

Pagina 5 - Contents

Creating a Module Object * Prototype for Trans_Inc D Trans_Inc PR 11P 2 D Prod 10P 0 VALUE D Quantity 5P 0 VALUE D Discount 2P 2 VALUE* Prototy

Pagina 6

Creating a Module Object *=================================================================** MODULE NAME: TRANSRPT* RELATED FILES: TRNSDTA (PF)*

Pagina 7

Creating a Module Object A*****************************************************************A* RELATED FILES: TRNSRPT *A* DESCRIPTION: This is the

Pagina 8

Binding Modules into a Program Binding Modules into a ProgramBinding is the process of creating a runnable ILE program by combining one ormore modu

Pagina 9

Binding Modules into a Program In addition to binding modules together, you can also bind them to service pro-grams (type *SRVPGM). Service program

Pagina 10

Binding Modules into a Program terminate when the program does. Whether or not you set on LR, your programwill have a fresh copy of its data the ne

Pagina 11

Binding Modules into a Program 9. Once all the imports have been resolved, the binding process completes andthe program object is created.Note: If

Pagina 12

Using a Binder Listing Product name Quantity Income------------------------------ -------- ------------Large 245 330,750.00Super 15 52,500.00Sup

Pagina 13

Using a Program-Described WORKSTN File without a Format Name ... 340Valid WORKSTN File Operations ... 341EXFMT Operation .

Pagina 14 - Trademarks and Service Marks

Changing a Module or Program The information in this listing can help you diagnose problems if the binding wasnot successful, or give feedback abou

Pagina 15 - Notices xiii

Changing a Module or Program Note: In the remainder of this section the term 'object' will be used to refer toeither an ILE module or IL

Pagina 16

Changing a Module or Program level again afterwards to improve the program efficiency as you get the programready for production. To determine the

Pagina 17 - About This Guide

Changing a Module or Program An alternative is to compress the object, using the Compress Object (CPROBJ)command. A compressed object takes up less

Pagina 18 - How to Send Your Comments

Changing a Module or Program 90 ILE RPG for AS/400 Programmer's Guide

Pagina 19 - What's New This Release?

Service Program Overview Chapter 8. Creating a Service ProgramThis chapter provides:¹ An overview of the service program concept¹ Strategies for cr

Pagina 20

Creating a Service Program Using CRTSRVPGM Strategies for Creating Service ProgramsWhen creating a service program, you should keep in mind:1. Whet

Pagina 21 - About This Guide xix

Creating a Service Program Using CRTSRVPGM See “Creating the Service Program” on page 97 for an example of using theCRTSRVPGM command.Table 9. Pa

Pagina 22

Sample Service Program Sample Service ProgramThe following example shows how to create a service program CVTTOHEX whichconverts character strings t

Pagina 23 - About This Guide xxi

Sample Service Program *=================================================================** CvtToHex - convert input string to hex output string

Pagina 24

Analyzing Your Conversion ... 393Using the Conversion Report ... 394Using the Log File ...

Pagina 25 - ILE RPG Introduction

Sample Service Program *-----------------------------------------------------------------** Use the operational descriptors to determine the leng

Pagina 26

Sample Service Program *=================================================================** CvtToHex - convert input string to hex output string

Pagina 27 - RPG IV Specifications

Sample Service Program Note that a binding directory is not required here because all modules neededto create the service program have been specifi

Pagina 28 - Cycle Programming

Sample Service Program *----------------------------------------------------------------** Program to test Service Program CVTTOHEX * * ** 1. Use

Pagina 29 - Indicators

Sample Service Program Updating the Service ProgramBecause of the binder language, the service program could be updated and theprogram CVTHEXPGM wo

Pagina 30 - Example of an ILE RPG Program

Sample Service Program Create Program Page 15769SS1 V4R4M0 990521 MYLIB/CVTHEXPGM AS400S01 07/30/99 23:24:00 Program . . . . . . . . . . . . . .

Pagina 31 - 1 6 10 16

Sample Service Program 102 ILE RPG for AS/400 Programmer's Guide

Pagina 32

Running a Program Using the CL CALL Command Chapter 9. Running a ProgramThis chapter shows you how to:¹ Run a program and pass parameters using the

Pagina 33

Running a Program Using the CL CALL Command Passing Parameters using the CL CALL CommandYou use the PARM option of the CL CALL command to pass para

Pagina 34 - The Entire Source Program

Running a Program Using the CL CALL Command *===============================================================** PROGRAM NAME: EMPRPT2 ** RELATED F

Pagina 35

NoticesThis information was developed for products and services offered in the U.S.A. IBMmay not offer the products, services, or features discuss

Pagina 36 - Interacting with the System

Running a Program From a Menu-Driven Application A*****************************************************************A* DESCRIPTION: This is the DD

Pagina 37 - AS/400 Tools

Running a Program From a Menu-Driven Application A* Free Form Menu: PAYROL A*A DSPSIZ(24 80 *DS3 -A 27 132 *DS4) A CHGINPDFT A INDARA A PRINT(*L

Pagina 38 - AS/400 Tools

Replying to Run-Time Inquiry Messages Running a Program Using a User-Created CommandYou can create a command to run a program by using a command de

Pagina 39 - AS/400 Tools

Managing Activation Groups where sequence-no is a number from 1-9999, which reflects where in the list theentry is being added, and message-id is t

Pagina 40

Managing Activation Groups programs activated within one activation group are developed as one cooperativeapplication.You identify the activation g

Pagina 41 - Program Creation

Managing Activation Groups If you create an ILE RPG program with ACTGRP(*NEW), you can then call theprogram as many times as you want without retur

Pagina 42 - RPG Programming in ILE

Managing Activation Groups Deleting an Activation GroupWhen an activation group is deleted, its resources are reclaimed. The resourcesinclude stati

Pagina 43 - Program Call

Managing Dynamically-Allocated Storage For more information on the RCLRSC command, refer to the CL Reference(Abridged). For more information on the

Pagina 44 - Bindable APIs

Managing Dynamically-Allocated Storage Note: Although the ALLOC operation code works only with the default heap, theREALLOC and DEALLOC operation

Pagina 45 - Multithreaded Applications

Managing Dynamically-Allocated Storage *-----------------------------------------------------------------** S U B P R O C E D U R E S * *-------

Pagina 46

Such information may be available, subject to appropriate terms and conditions,including in some cases, payment of a fee.The licensed program desc

Pagina 47 - OPM-Compatible Application

Managing Dynamically-Allocated Storage *-----------------------------------------------------------------* * ** After: Now the names name@, name_

Pagina 48 - Effect of ILE

Managing Dynamically-Allocated Storage *-----------------------------------------------------------------** Display - display the list * *------

Pagina 49 - Related Information

Managing Dynamically-Allocated Storage *-----------------------------------------------------------------** Free - release the storage used by th

Pagina 50

Managing Dynamically-Allocated Storage *-----------------------------------------------------------------** Heap Storage Misuse * *-------------

Pagina 51

Managing Dynamically-Allocated Storage procedures in the module DYNARRAY dynamically allocate storage for a practicallyunbounded packed array. The

Pagina 52

Managing Dynamically-Allocated Storage *=================================================================* DYNARRAY : Handle a (practically) unbo

Pagina 53

Managing Dynamically-Allocated Storage *-----------------------------------------------------------------* Interface to the CEEDSHP API (Discard

Pagina 54 - Advanced Application Scenario

Managing Dynamically-Allocated Storage *=================================================================* DYNA_INIT: Initialize the array. ** Fu

Pagina 55 - A Strategy to Avoid

Managing Dynamically-Allocated Storage *=================================================================* DYNA_SET: Set an array element. ** Fun

Pagina 56 - A Strategy to Avoid

Managing Dynamically-Allocated Storage ** Calculate the new number of elements. If the index is* greater than the current number of elements in th

Pagina 57 - Procedures

Registered trademarks and unregistered trademarks are denoted by  and respectively. Notices xiii

Pagina 58 - Prototyped Calls

Managing Dynamically-Allocated Storage The logic of the subprocedures is as follows:1. DYNA_INIT creates the heap using the ILE bindable API CEECRH

Pagina 59 - Multiple Procedures Module

Program/Procedure Call Overview Chapter 10. Calling Programs and ProceduresIn ILE, it is possible to call either a program or procedure. Furthermor

Pagina 60

Program/Procedure Call Overview ¹ Recursion¹ Parameter passing considerations Calling ProgramsYou can call OPM or ILE programs by using program c

Pagina 61

Program/Procedure Call Overview ples of using procedure pointers, see the section on the procedure pointer datatype in ILE RPG for AS/400 Reference

Pagina 62

Program/Procedure Call Overview Recursive CallsRecursive calls are only allowed for subprocedures. A recursive call is one whereprocedure A calls

Pagina 63

Program/Procedure Call Overview PGM XPRC_BPRC_APRC_CRecursive CallCall Stack (bottom entry is most recent)PRC_AFigure 60. Recursive Call Stack To

Pagina 64

Program/Procedure Call Overview Sometimes you may not be sure of the exact format of the data that is beingpassed to you. In this case you may requ

Pagina 65 - The Entire ARRSRPT Program

Using a Prototyped Call Table 10. Parameter Passing OptionsParameter Option Prototyped NotPrototypedSee PageCompile-time parametercheckingYes 135

Pagina 66

Using a Prototyped Call To call a prototyped program or procedure follow these general steps:1. Include the prototype of the program or procedure t

Pagina 67

Passing Prototyped Parameters Examples of Free-Form CallFor examples of using the CALLP operation, see:¹ Figure 22 on page 41¹ Figure 43 on page 97

Pagina 68 - Figure 24. DDS for CUSTFILE

xiv ILE RPG for AS/400 Programmer's Guide

Pagina 69 - General Considerations

Passing Prototyped Parameters Passing by ValueWith a prototyped procedure, you can pass a parameter by value instead of byreference. When a paramet

Pagina 70 - Subprocedure Considerations

Passing Prototyped Parameters *-------------------------------------------------------------* The procedure returns a value of a 10-digit integer

Pagina 71 - Subprocedures

Passing Prototyped Parameters To pass a parameter by read-only reference, specify the keyword CONST on thedefinition specification of the parameter

Pagina 72 - Prototyped Call

Passing Prototyped Parameters are then built by the calling procedure and passed as hidden parameters to thecalled procedure. Operational descripto

Pagina 73 - Concepts

Passing Prototyped Parameters Passing *OMITYou can pass *OMIT for a prototyped parameter if the called procedure is awarethat *OMIT might be passe

Pagina 74

Passing Prototyped Parameters Checking for the Number of Passed ParametersAt times it may be necessary to check for the number of parameters that a

Pagina 75 - Development Manager

Passing Prototyped Parameters 2. Correct the street number for printing using the subroutine GetStreet#.3. Concatenate the complete address. 4. Re

Pagina 76 - Using SEU

Passing Prototyped Parameters *=================================================================** SUBROUTINE: GetStreet#* Get the character form

Pagina 77 - Using SEU

Passing Prototyped Parameters *=================================================================** PRTADDR - Print an address* Calls FmtAddr to f

Pagina 78

Passing Prototyped Parameters *-----------------------------------------------------------------** 'Program 2'- Use of FMTADDR before p

Pagina 79 - Using SQL Statements

About This GuideThis guide provides information that shows how to use the ILE RPG for AS/400compiler (ILE RPG) in the Integrated Language Environm

Pagina 80 - Using SQL Statements

Passing Prototyped Parameters Figure 71 on page 146 shows the prototype for QCMDEXC, where the first param-eter is defined with OPTIONS(*VARSIZE) m

Pagina 81 - Using the CRTBNDRPG Command

For information on the data types supported by different HLLs, consult the appro-priate language manual.Table 11. RPG Parameter Passing MethodsPa

Pagina 82

Using the Fixed-Form Call Operations | For ILE C, declare the returned value as a struct with a subfield of type char.| (The RPG return value can a

Pagina 83

Using the Fixed-Form Call Operations 2. Optionally code an error indicator (positions 73 and 74) or an LR indicator(positions 75 and 76) or both.Wh

Pagina 84

Using the Fixed-Form Call Operations For more information on operational descriptors, see “Using OperationalDescriptors” on page 138.¹ There are fu

Pagina 85 - Display spooled files

Using the Fixed-Form Call Operations If insufficient parameters are specified when calling a procedure, an error occurswhen an unresolved parameter

Pagina 86

Returning from a Called Program or Procedure Multiple PLISTs can appear in a procedure. However, only one *ENTRY PLIST canbe specified, and only in

Pagina 87 - Obtaining a Compiler Listing

Returning from a Called Program or Procedure ¹ The RETURN operation (with a blank factor 2) is processed, the H1 through H9indicators are not on, a

Pagina 88 - Customizing a Page Heading

Returning from a Called Program or Procedure ¹ All files that are open are closed.¹ Any data areas locked by the procedure are unlocked.¹ If the ma

Pagina 89 - Customizing the Spacing

Using Bindable APIs A subprocedure ends abnormally and control returns to the calling procedurewhen an unhandled exception occurs. Again, no furthe

Pagina 90 - Correcting Compilation Errors

Prerequisite and Related InformationUse the AS/400 Information Center as your starting point for looking up AS/400technical information. You can a

Pagina 91 - Using a Compiler Listing

Calling a Graphics Routine You access ILE bindable APIs using the same call mechanisms used by ILE RPGto call procedures, that is, the CALLP operat

Pagina 92 - Correcting Run-time Errors

Multithreading Considerations ¹ The name of the graphics routine you want to run.¹ The appropriate parameters for the specified graphics routine. T

Pagina 93

Multithreading Considerations | THREAD(*SERIALIZE) will protect most of your variables and all your internal| control structures from being accesse

Pagina 94

Multithreading Considerations | *-----------------------------------------------------------------------------------| * .---------------.| * | |

Pagina 95

Multithreading Considerations | complete their calls, since each module will be locked by the thread in the other| module. This type of problem can

Pagina 96

Debugging and Exception HandlingThis section describes how to:¹ Debug an Integrated Language Environment application by using the IntegratedLanguag

Pagina 97 - CRTPGM Commands

162 ILE RPG for AS/400 Programmer's Guide

Pagina 98 - Using the CRTRPGMOD Command

The ILE Source Debugger Chapter 11. Debugging ProgramsDebugging allows you to detect, diagnose, and eliminate run-time errors in aprogram. You can

Pagina 99 - Creating a NOMAIN Module

The ILE Source Debugger ¹ Equate a shorthand name with a field, expression, or debug commandBefore you can use the source debugger, you must select

Pagina 100 - Creating a Module Object

The ILE Source Debugger STEP Allows you to run one or more statements of the procedure beingdebugged.| TBREAK Permits you to enter either an uncond

Pagina 101 - Creating a Module Object

|What's New This Release?| The major enhancements to RPG IV since V4R2 are the support for running ILE| RPG modules safely in a threaded envir

Pagina 102

Preparing a Program for Debugging 7. From the help panel which appears, you can select a number of topics per-taining to RPG, such as displaying va

Pagina 103

Preparing a Program for Debugging Table 13. Debug ViewsDebug View Debug Data DBGVIEW Param-eter ValueNone No debug data *NONEStatement view(defau

Pagina 104 - Related CL Commands

Preparing a Program for Debugging Creating a COPY Source ViewA COPY source view contains text from the root source member, as well as thetext of al

Pagina 105

Preparing a Program for Debugging members into the module object. There is no dependency on the source membersupon which it is based, once the list

Pagina 106 - Using the CRTPGM Command

Starting the ILE Source Debugger If the default values for either create command have been changed, you mustexplicitly specify DBGVIEW(*STMT) and O

Pagina 107

Starting the ILE Source Debugger STRDBG ExampleTo start a debug session for the sample debug program DEBUGEX and a calledOPM program RPGPGM, type:

Pagina 108 - Binding Multiple Modules

Adding/Removing Programs from a Debug Session Changing the debug options using the SET debug command affects the value forthe corresponding paramet

Pagina 109 - Using a Binder Listing

Adding/Removing Programs from a Debug Session Example of Adding a Service Program to a Debug SessionIn this example you add the service program CVT

Pagina 110 - Changing a Module or Program

Viewing the Program Source  Work with Module List System: AS400S1 Type options, press enter.1=Add program 4=Remove program 5=Display module sour

Pagina 111 - Using the UPDPGM Command

Viewing the Program Source Viewing a Different ModuleTo change the module object that is shown on the Display Module Source display,use option 5 (D

Pagina 113 - CL Reference (Abridged)

| – *SRCSTMT allows you to assign statement numbers for debugging from| the source IDs and SEU sequence numbers in the compiler listing. (The| sta

Pagina 114

Viewing the Program Source  Display Module Source Program: DEBUGEX Library: MYLIB Module: CPROC 1 #include <stdlib.h> 2 #include <stri

Pagina 115 - Service Program Overview

Setting and Removing Breakpoints  Display Module Source ... : Select V

Pagina 116 - Reference (Abridged)

Setting and Removing Breakpoints is shown with the source positioned at the line where the breakpoint occurred. Thisline is highlighted. At this po

Pagina 117 - Related CL commands

Setting and Removing Breakpoints display. A list of options appear which allow you to set or remove breakpoints. Ifyou select 4 (Clear), a job brea

Pagina 118 - Sample Service Program

Setting and Removing Breakpoints  Display Module Source Program: DEBUGEX Library: MYLIB Module: DBGEX 84 *--------------------------------------

Pagina 119 - Sample Service Program

Setting and Removing Breakpoints The current thread is the thread that is currently being debugged. Debug com-mands are issued to this thread. When

Pagina 120 - Sample Service Program

Setting and Removing Breakpoints is encountered. The relational operators supported for conditional breakpoints arenoted at the beginning of this s

Pagina 121 - Creating the Service Program

Setting and Removing Breakpoints 5. After the breakpoint is set, press F12 (Cancel) to leave the Work with ModuleBreakpoints display. Press F3 (End

Pagina 122 - Binding to a Program

Setting and Removing Breakpoints This corresponds to the RPG graphic data type.NLSS applies only to non-numeric conditional breakpoint expressions

Pagina 123

Setting and Removing Breakpoints Table 14. Non-numeric Conditional Breakpoint ExpressionsType PossibleChar-8 ¹ Character field compared to charac

Pagina 124 - Sample Binder Listing

|Table 1. Changed Language Elements Since V4R2| Language Unit| Element| Description| Control specifi-| cation keywords| OPTION(*{NO}SRCSTMT)| *SR

Pagina 125

Setting and Removing Breakpoints | Line <--------------------- Source Specifications ----------------------------------------------><----

Pagina 126

Setting and Removing Breakpoints ||| Display Module Source| Program: MYPGM Library: MYLIB Module: MYPGM| 33 002500 * Begin-procedure| 34 0

Pagina 127 - Chapter 9. Running a Program

Setting and Removing Watch Conditions To remove a conditional thread breakpoint using the Work with Module Breakpointsdisplay:1. Type 4 (Clear) in

Pagina 128 - CL Programming

Setting and Removing Watch Conditions Characteristics of WatchesYou should know the following characteristics about watches before working withthem

Pagina 129

Setting and Removing Watch Conditions Setting Watch ConditionsBefore you can set a watch condition, your program must be stopped under debug,and th

Pagina 130 - Figure 48. DDS for EMPRPT2

Setting and Removing Watch Conditions  Work with Watch ... : Display Watch : DEBUGGER : :

Pagina 131

Setting and Removing Watch Conditions Displaying Active WatchesTo display a system-wide list of active watches and show which job set them, type:DS

Pagina 132

Example of Setting a Watch Condition Example of Setting a Watch ConditionIn this example, you watch a variable SALARY in program MYLIB/PAYROLL. To

Pagina 133 - Managing Activation Groups

Stepping Through the Program Object  Display Module Source (Source not available) F3=End program F12=Resume F14=Work with module list F18=Work wi

Pagina 134 - Managing Activation Groups

Stepping Through the Program Object on the debug command line, the next five statements of your program object arerun, then the program object is s

Pagina 135 - Managing Activation Groups

|Table 2 (Page 1 of 2). New Language Elements Since V4R2Language Unit Element Description| Control specifi-| cation keywords| CCSID(*GRAPH:|

Pagina 136 - Reclaim Resources Command

Stepping Through the Program Object Stepping Into Call StatementsYou can step into a call statement by using:¹ F22 (Step into) on the Display Modul

Pagina 137 - (Abridged)

Stepping Through the Program Object Example of Stepping Into an OPM Program Using F22In this example, you use the F22 (Step Into) to step into the

Pagina 138

Stepping Through the Program Object  Display Module Source Program: RPGPGM Library: MYLIB 1 *===================================================

Pagina 139

Stepping Through the Program Object  Display Module Source Program: DEBUGEX Library: MYLIB Module: DBGEX 141 142 *=============================

Pagina 140

Stepping Through the Program Object on the debug command line. The variable field-name is the name of the field, datastructure, or array that you w

Pagina 141

Stepping Through the Program Object | Scalar Fields RPG Definition| > EVAL String 6A INZ('ABCDEF')| STRING = 'ABCDEF'| >

Pagina 142 - Heap Storage Problems

Stepping Through the Program Object Displaying the Contents of an ArraySpecifying an array name with EVAL will display the full array. To display o

Pagina 143

Stepping Through the Program Object 3 DIM(3) CTDATA Compile-time data: **> EVAL TableA ** Show value at aaaTABLEA = 'aaa' current i

Pagina 144 - System API Reference

Stepping Through the Program Object ** Note that you can enter the data structure name or a subfield name. **> EVAL DS3TITLE OF DS3 = 'Mr.

Pagina 145

Stepping Through the Program Object > EVAL IN02Identifier does not exist.> EVAL *IN02*IN02 = '1'> EVAL *IN(02)*IN(02) = '1&

Pagina 146

|Table 2 (Page 2 of 2). New Language Elements Since V4R2| Language Unit| Element| Description| Operation codes| EVALR| Evaluates an assignmen

Pagina 147

Stepping Through the Program Object | Displaying UCS-2 Data| The value displayed for UCS-2 fields has been translated into readable characters.| Fo

Pagina 148

Stepping Through the Program Object The %SUBSTR built-in function allows you to substring a string variable. The firstparameter must be a string id

Pagina 149

Changing the Value of Fields Use the %VARS debug built-in function when the variable name conflicts with anyof the debug command names. For example

Pagina 150

Changing the Value of Fields When assigning literals to fields, the normal RPG rules apply:¹ Character literals should be in quotes.¹ Graphic liter

Pagina 151

Equating a Name with a Field, Expression, or Command Displaying Attributes of a FieldYou can display the attributes of a field using the Attribute

Pagina 152 - Calling Procedures

Sample Source for Debug Examples EQUATE shorthand-name definitionon the debug command line. shorthand-name is the name that you want to equatewith

Pagina 153 - The Call Stack

Sample Source for Debug Examples CRTRPGMOD MODULE(MYLIB/DBGEX) SRCFILE(MYLIB/QRPGLESRC) DBGVIEW(*ALL)TEXT('Main module for Sample Debug Progra

Pagina 154 - Recursive Calls

Sample Source for Debug Examples * Pointers D NullPtr S * INZ(*NULL) D BasePtr S * INZ(%ADDR(String)) D ProcPtr S * ProcPtr INZ(%PADDR('c

Pagina 155

Sample Source for Debug Examples *=================================================================** Now the operation to modify values or call

Pagina 156

Sample Source for Debug Examples *-----------------------------------------------------------------** After the following SETON operation, *IN02

Pagina 157 - Using the CALLP Operation

xxii ILE RPG for AS/400 Programmer's Guide

Pagina 158 - Calling within an Expression

Sample Source for Debug Examples #include <stdlib.h> #include <string.h> #include <stdio.h>extern char EXPORTFLD[6];char *c_p

Pagina 159 - Parameter Passing Styles

Exception Handling Overview Chapter 12. Handling ExceptionsThis chapter explains how ILE RPG exception handling works, and how to use: ¹ Exceptio

Pagina 160 - Passing by Value

Exception Handling Overview ¹ Optionally recovering from the exception by passing the exception informationto a piece of code to take any necessary

Pagina 161

Exception Handling Overview Program AProgram ASendingTerminatingException CEE9901Proc. P1Proc. P1Proc. P2Proc. P2Proc. P3exceptionoccursProc. P3exc

Pagina 162 - Using Operational Descriptors

Exception Handling Overview tion. If it remains unhandled, then the entry is removed and the function check ispercolated. The process repeats until

Pagina 163 - Omitting Parameters

Exception Handling Overview 2. If an 'E' operation code extender is present on the calculation specification andthe exception is one that

Pagina 164 - Leaving Out Parameters

Exception Handling Overview ¹ If there is no *PSSR and a function check occurs, the procedure is removedfrom the call stack and the exception is pe

Pagina 165 - Using %PARMS

Using Exception Handlers Using Exception HandlersPlanning the exception handling capability of your application means making thefollowing decisions

Pagina 166 - 4. Return

Using Exception Handlers (when R is chosen). For example, any read operation will be retried if the readfailed because of record locking.For other

Pagina 167

Using Exception Handlers Note: The same exception handling events described would apply to a procedurecall (CALLB operation) as well.Example of Un

Pagina 168

ILE RPG IntroductionBefore using ILE RPG to create a program, you must know certain aspects of theenvironment in which you will be using it. This p

Pagina 169

The following then occurs:1. Since there are no error indicators coded in PRC2, PRC2 cannot handle thefunction check, and so it is unhandled.2. Si

Pagina 170 - Interlanguage Calls

This section provides some examples of how to use each of these RPG constructs.The ILE RPG for AS/400 Reference provides more information on the *P

Pagina 171 - Passing By Value

When you specify an error indicator or an 'E' extender on an operation code, youcan explicitly call a file error subroutine (INFSR) or a

Pagina 172

subroutine is called again. The procedure will loop unless you code the subrou-tine to avoid this problem.To see how to code an error subroutine to

Pagina 173

Note that the File specification for PRDMAS identifies both the INFDS and identifiesthe INFSR to be associated with it.The following is done for e

Pagina 174 - Examples of CALL and CALLB

*-----------------------------------------------------------------** Access the product master file using the transaction product * * number. *

Pagina 175 - Using the PLIST Operation

Using a Program Error SubroutineTo handle a program error or exception you can write a program error subroutine(*PSSR). When a program error occur

Pagina 176 - Normal End

*-----------------------------------------------------------------** Define relevant parts of program status data structure * *-----------------

Pagina 177 - Abnormal End

*-----------------------------------------------------------------** Start of subprocedure definition *----------------------------------------

Pagina 178 - Returning from a Subprocedure

*-----------------------------------------------------------------** Start of subprocedure definition *-----------------------------------------

Pagina 179 - Using Bindable APIs

2 ILE RPG for AS/400 Programmer's Guide

Pagina 180 - Calling a Graphics Routine

*=================================================================** NOLOOP: Show how to avoid recursion in a *PSSR subroutine. * *============

Pagina 181 - Multithreading Considerations

5. The ENDSR operation receives control, and the procedure is canceled.The approach used here to avoid looping can also be used within an INFSR err

Pagina 182

ILE Condition Handlers ILE Condition HandlersILE condition handlers are exception handlers that are registered at run timeusing the Register ILE Co

Pagina 183

ILE Condition Handlers | pointer to a communication area between SHOWERR and RPGHDLR, and a fieldto contain the possible actions, resume or percola

Pagina 184 - Figure 74. Deadlock Example

ILE Condition Handlers | D CondTok DS BASED(pCondTok)| D MsgSev 5I 0| D MsgNo 2A| D 1A| D MsgPrefix 3A| D MsgKey 4A| D CommArea DS BAS

Pagina 185 - ¹ Obtain a dump

ILE Condition Handlers requires a definition for the error-prone array ARR1, and identification of the param-eter lists used by the ILE bindable AP

Pagina 186

ILE Condition Handlers | *=================================================================*| * SHOWERR: Show exception handling using a user-def

Pagina 187 - The ILE Source Debugger

ILE Condition Handlers | *-----------------------------------------------------------------*| * Register the handler and generate errors *| *--

Pagina 188 - Debug Commands

*=================================================================** *PSSR: Error Subroutine for the procedure * *=============================

Pagina 189 - The ILE Source Debugger

handler remains in effect until the call stack entry is removed, or until CEEUTX iscalled to disable it. See the System API Reference for more info

Pagina 190

RPG IV Overview Chapter 1. Overview of the RPG IV Programming LanguageThis chapter presents a high-level review of the features of the RPG IV progr

Pagina 191 - Creating a Root Source View

*-----------------------------------------------------------------* Procedure Enabler. This procedure enables a cancel handler,* then gets an er

Pagina 192 - Creating a Listing View

*-----------------------------------------------------------------* Define the cancel handler. The parameter is a pointer to the* 'communica

Pagina 193 - Creating a Statement View

If you encounter this problem, you have two possible ways to avoid it:1. Ensure that the caller is in a different activation group from the ILE RP

Pagina 194

*----------------------------------------------------------------* Handle information or warning messages, otherwise percolate *----------------

Pagina 195 - Setting Debug Options

250 ILE RPG for AS/400 Programmer's Guide

Pagina 196 - OPM source debug support

Using the DUMP Operation Code Chapter 13. Obtaining a DumpThis chapter describes how to obtain an ILE RPG formatted dump and provides asample forma

Pagina 197 - Program/module

Example of a Formatted Dump ¹ If a DUMP operation is bypassed by a GOTO operation, the DUMP operationdoes not occur.Example of a Formatted DumpThe

Pagina 198 - Viewing the Program Source

Example of a Formatted Dump .E/ ILE RPG routine in which the exception or error occurred..F/ CPF or MCH for a machine exception..G/ Information abo

Pagina 199 - Viewing a Different Module

Example of a Formatted Dump INFDS FILE FEEDBACK .I/ File . . . . . . . . . . . . . . . . . : QSYSPRT File Open . . . . . . . . . . . . . . : YES F

Pagina 200 - Changing the View of a Module

Example of a Formatted Dump .J/ This is the file open feedback information for the file. See the Data Man-agement manual for a description of the f

Pagina 201

RPG IV Overview Cycle ProgrammingWhen a system processes data, it must do the processing in a particular order.This logical order is provided by:¹

Pagina 202

Example of a Formatted Dump ILE RPG FORMATTED DUMP Module Name. . . . . . . . . . . . . . : DBGEX2 Optimization Level . . . . . . . . . . : *NONE

Pagina 203 - DISPLAY MODULE module-name

Example of a Formatted Dump DS1 DS OCCURS(3) .R/ OCCURRENCE(1)FLD1 CHAR(5) '1BCDE' 'F1C2C3C4C5'X FLD1A CHAR(1) DIM(5) (1

Pagina 204

Example of a Formatted Dump .N/ Beginning of user variables, listed in alphabetical order, and grouped byprocedure. Data that is local to a subproc

Pagina 205

Working with Files and DevicesThis section describes how to use files and devices in ILE RPG programs. Specif-ically, it shows how to:¹ Associate a

Pagina 206 - Condition

260 ILE RPG for AS/400 Programmer's Guide

Pagina 207 - BREAK Command

Associating Files with Input/Output Devices Chapter 14. Defining FilesFiles serve as the connecting link between a program and the device used for

Pagina 208

Associating Files with Input/Output Devices SPECIAL. Figure 126 on page 262 shows a file description specification for adisplay (WORKSTN) file FILE

Pagina 209 - procedure-name

Types of File Descriptions RPG programFILEYFile name - FILEYDevice = SEQDevice type =PRINTERFile type =DEVICEFigure 128. Associating a file name

Pagina 210

Types of File Descriptions ¹ Less maintenance activity when the file’s record format is changed. You canoften update programs by changing the file’

Pagina 211 - statement-number

Defining Externally Described Files .2/ An externally described file (that is, a file with field-level externaldescription) is used as a program-de

Pagina 212 - CLEAR PGM

RPG IV Overview .2/ RPG reads the next record and sets on the record identifying andcontrol level indicators..3/ RPG processes total calculations (

Pagina 213 - Characteristics of Watches

Defining Externally Described Files Renaming Record-Format NamesMany of the functions that you can specify for externally described files (such ast

Pagina 214 - Setting Watch Conditions

Defining Externally Described Files Once a record-format is ignored, it cannot be specified for any other keyword(SFILE, RENAME, or INCLUDE), or fo

Pagina 215

Defining Externally Described Files with an indicator, and you then try to rename the field referencing theunprefixed name, you will get an error.

Pagina 216 - Removing Watch Conditions

Defining Externally Described Files field in positions 49 through 62 and assign a match-level value in posi-tions 65 and 66.In this example, the CU

Pagina 217 - following

Defining Externally Described Files ¹ In the creation of a new record, the fields specified in the output field specifica-tions are placed in the r

Pagina 218

Data Management Operations and ILE RPG I/O Operations The RPG program does not provide level checking for program-described files orfor files using

Pagina 219 - Stepping Over Call Statements

Data Management Operations and ILE RPG I/O Operations Table 17. Data Management Operations and the Corresponding RPG I/O OperationData Management

Pagina 220 - Stepping Into Call Statements

Overriding and Redirecting File Input and Output Chapter 15. General File ConsiderationsThis chapter provides information on the following aspects

Pagina 221

Overriding and Redirecting File Input and Output in the program. For example, if the RPG device name is PRINTER, and the actualfile the program con

Pagina 222

File Locking RPG programExecution Time:No OverrideFile name = QTAPEFormat=EDevice = SEQCompile Time:Override FileQTAPE toFile FMT1QTAPEFMT1File typ

Pagina 223

AS/400e ÉÂÔILE RPG for AS/400Programmer's GuideVersion 4 SC09-2507-02

Pagina 224

Example of an ILE RPG Program Each RPG IV indicator has a two-character name (for example, LR, 01, H3), and isreferred to in some entries of some s

Pagina 225

Record Locking Record LockingWhen a record is read by a program, it is read in one of two modes: input orupdate. If a program reads a record for u

Pagina 226

Sharing an Open Data Path included. These output operations can be processed by EXCEPT output, detailoutput, or total output.(There are exceptions

Pagina 227 - Displaying Data Structures

Spooling ¹ If a program sharing an open data path for an externally described file tries touse a record format that the first program ignored¹ If a

Pagina 228 - Displaying Indicators

SRTSEQ/ALTSEQ Output SpoolingOutput spooling is valid for batch or interactive jobs. The description of the file thatis specified in the RPG progr

Pagina 229

SRTSEQ/ALTSEQ 280 ILE RPG for AS/400 Programmer's Guide

Pagina 230 - Displaying UCS-2 Data

Database Files Chapter 16. Accessing Database FilesYou can access a database file from your program by associating the file namewith the device DIS

Pagina 231

Using Externally Described Disk Files Using Externally Described Disk FilesExternally described DISK files are identified by an E in position 22 of

Pagina 232 - Changing the Value of Fields

Using Externally Described Disk Files *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*A...T.Name++++++.Len++TDpB...F

Pagina 233

Using Externally Described Disk Files *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*A...T.Name++++++RLen++TDpB...F

Pagina 234

Using Externally Described Disk Files RPG program, an edit code must be specified for the field in the outputspecifications..2/ The CHECK(MF) entry

Pagina 235 - DISPLAY EQUATE

Example of an ILE RPG Program *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*A...T.Name++++++RLen++TDpB...Functions

Pagina 236

Using Externally Described Disk Files Valid Search ArgumentsYou can specify a search argument in the ILE RPG operations CHAIN, DELETE,READE, READPE

Pagina 237

Using Externally Described Disk Files ¹ A search argument cannot refer to a portion of a key field.If a search argument refers to a partial key, th

Pagina 238

Using Program-Described Disk Files no record blocking is done by the compiler, nor by data management. If thekeyword BLOCK is not specified, then d

Pagina 239

Using Program-Described Disk Files *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*A...T.Name++++++.Len++TDpB...Func

Pagina 240

Using Program-Described Disk Files On the file description specifications, the length of the key field is defined as 10 inpositions 29 through 33 (

Pagina 241 - Exception Handling Overview

Methods for Processing Disk Files Limits RecordsFor sequential-within-limits processing, the record-address file contains limitsrecords. A limits

Pagina 242

Methods for Processing Disk Files Table 19 on page 292 shows the valid entries for positions 28, 34, and 35 of thefile description specification fo

Pagina 243 - which is active on

Methods for Processing Disk Files If, in the same job or activation group, two logical files use the same physical file,and one file is processed c

Pagina 244 - ILE RPG Exception Handling

Methods for Processing Disk Files A*****************************************************************A* DESCRIPTION: This is the DDS for the physi

Pagina 245 - Exception Handling Overview

Methods for Processing Disk Files as the ENUM field plus the WEEKNO (week number) field, which is a compositekey. ********************************

Pagina 246

Example of an ILE RPG Program ¹ The TRANSACT file is defined as the Input Primary file. The ILE RPG programcycle controls the reading of records fr

Pagina 247 - Unhandled Exceptions

Methods for Processing Disk Files EXAMPLE PROGRAM 2 (Sequential-by-Key Using READ): This example is thesame as the previous example except that th

Pagina 248 - Using Exception Handlers

Methods for Processing Disk Files OPRINT H 1P 2 6O 40 'EMPLOYEE WEEKLY WORKING 'O 52 'HOURS REPORT' O H01 1O 12 'EMPLOY

Pagina 249 - Using Exception Handlers

Methods for Processing Disk Files C 01 Z-ADD 0 TOTHRS 5 1 C 01 Z-ADD 0 TOTOVT 5 1 C 01 SETOFF 12 C* C MR IF (*IN02='1') C ADD EHW

Pagina 250 - Using RPG-Specific Handlers

Methods for Processing Disk Files Random-by-Key ProcessingFor the random-by-key method of processing, a search argument that identifies thekey of

Pagina 251 - ILE RPG for AS/400 Reference

Methods for Processing Disk Files ***************************************************************** * PROGRAM NAME: EMSTUPD ** RELATED FILES: EM

Pagina 252 - Using an Error Subroutine

Methods for Processing Disk Files limits record. If the two limits supplied by the record-address file are equal, onlythe records with the specifie

Pagina 253

Methods for Processing Disk Files ***************************************************************** * PROGRAM NAME: ESWLIM1 ** RELATED FILES: EM

Pagina 254

Methods for Processing Disk Files ***************************************************************** * PROGRAM NAME: ESWLIM2 ** RELATED FILES: EM

Pagina 255

Valid File Operations When you update or add a record to a file by relative record number, the recordmust already have a place in the member. For a

Pagina 256

Valid File Operations Table 20. Valid File Operations for Keyed Processing Methods (Random by Key,Sequential by Key, Sequential within Limits)Fil

Pagina 257

Example of an ILE RPG Program *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+...OFilename++DF..N01N02N03Excnam++++B++A++Sb+S

Pagina 258

Valid File Operations Table 21. Valid File Operations for Non-keyed Processing Methods (Sequential,Random by Relative Record Number, and Consecut

Pagina 259

Using Commitment Control Using Commitment ControlThis section describes how to use commitment control to process file operations asa group. With co

Pagina 260

Using Commitment Control for commitment control before you issue the STRCMTCTL command, the openingof the file will fail.The CL command ENDCMTCTL n

Pagina 261

Using Commitment Control The default scope for a commitment definition is to the activation group of theprogram issuing the STRCMTCTL command, that

Pagina 262 - Using a Condition Handler

Using Commitment Control 5. Issue ROLBK.The changes made at step 3 are rolled back by the ROLBK operation at step 5,even though the file has been

Pagina 263 - ILE Condition Handlers

Using Commitment Control *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... *FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+

Pagina 264 - ILE Condition Handlers

DDM Files Figure 156 on page 312 is an example showing conditional commitment control.*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+.

Pagina 265

DDM Files The DDM file provides the information needed for a local system to locate a remotesystem and to access the data in the source file. For m

Pagina 266

DDM Files 314 ILE RPG for AS/400 Programmer's Guide

Pagina 267

Types of Device Files Chapter 17. Accessing Externally Attached DevicesYou can access externally attached devices from RPG by using device files.De

Pagina 268 - Using Cancel Handlers

Example of an ILE RPG Program P CalcPay BD CalcPay PI 8P 2D Rate 5P 2 VALUED Hours 10U 0 VALUED Bonus 5P 2 VALUED Overtime S 5P 2 INZ(0) * Determin

Pagina 269

Accessing Printer Devices Accessing Printer DevicesPRINTER files of ILE RPG programs associate with the printer files on the AS/400system:Printer f

Pagina 270

Accessing Printer Devices For either a program-described or an externally-described file, you can specify anindicator, *IN01 through *IN99, using t

Pagina 271

Accessing Printer Devices ¹ Skipping past the overflow line to any line on the same page sets the overflowindicator on.¹ Skipping past the overflow

Pagina 272

Accessing Printer Devices Table 23. Results of the Presence or Absence of an Overflow IndicatorFileDescriptionSpecificationsPositions 44-80Output

Pagina 273

Accessing Printer Devices *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... *OFilename++DF..N01N02N03Excnam++++B++A++Sb+Sa+

Pagina 274

Accessing Printer Devices OverflowOccursDuringGet aRecordTotalCalculationsTotalOutputOverflowPrintingT = TotalH = HeadingD = DetailE = ExceptionDet

Pagina 275 - Chapter 13. Obtaining a Dump

Accessing Printer Devices at overflow output time unless overflow is sensed again since the lasttime the overflow lines were written.Specifying Fet

Pagina 276 - Example of a Formatted Dump

Accessing Printer Devices The total lines with an F coded in position 18 can fetch the overflow routine. Theyonly do so if overflow is sensed prior

Pagina 277 - Feedback Areas

Accessing Printer Devices The values contained in the first four subfields of the ILE PRTCTL data structureare the same as those allowed in positio

Pagina 278

Accessing Tape Devices *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... *FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++

Pagina 279 - Example of a Formatted Dump

Example of an ILE RPG Program *------------------------------------------------------------------------* * Constant Declarations * *--------------

Pagina 280

Using Sequential Files Accessing Display DevicesYou use display files to exchange information between your program and a displaydevice such as a wo

Pagina 281 - .L/ Optimization level

Using SPECIAL Files Example of Specifying a Sequential FileFigure 162 shows an example of how to specify a SEQ file in an ILE RPG sourcemember.*..

Pagina 282 - not in the order

Using SPECIAL Files R Read a record and place it in the area defined by the areaparameter.W The ILE RPG program has placed a record in the areadefi

Pagina 283

Using SPECIAL Files Table 27. Valid File Operations for a SPECIAL FileFile Description SpecificationsPositionsCalculation Specifications Position

Pagina 284

Using SPECIAL Files *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... * DName+++++++++++ETDsFrom+++To/L+++IDc.Functions+++

Pagina 285 - Chapter 14. Defining Files

Using Externally Described WORKSTN Files Chapter 18. Using WORKSTN FilesInteractive applications on the AS/400 generally involve communication with

Pagina 286 - The SEQ Device

Using Externally Described WORKSTN Files In addition to the field descriptions (such as field names and attributes), the DDSfor a display-device fi

Pagina 287 - Types of File Descriptions

Using Externally Described WORKSTN Files *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*AAN01N02N03T.Name++++++RLen++TDpBLinP

Pagina 288 - Types of File Descriptions

Using Externally Described WORKSTN Files Specifying Function Key Indicators on Display Device FilesThe function key indicators, KA through KN and K

Pagina 289

Using Externally Described WORKSTN Files Processing an Externally Described WORKSTN FileWhen an externally-described WORKSTN file is processed, the

Pagina 290 - Ignoring Record Formats

Using the OS/400 System *------------------------------------------------------------------------* * Subprocedure -- calculates overtime pay. * *-

Pagina 291

Using Externally Described WORKSTN Files  Customer Name SearchSearch Code _______Number Name Address City StateXXXX XXXXXXXXXXXXXXXXXXXX XXXXXX

Pagina 292

Using Externally Described WORKSTN Files specifications require that a relative-record-number field be specified in the secondposition of the SFILE

Pagina 293 - Using Output Specifications

Using Program-Described WORKSTN Files *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*AAN01N02N03T.Name++++++RLen++TDpBLinPosF

Pagina 294 - Level Checking

Using Program-Described WORKSTN Files ¹ What data is sent¹ What ICF functions to perform.If a format name is used, input and output specifications

Pagina 295 - Data Management

Using Program-Described WORKSTN Files Input SpecificationsThe input specifications describe the record that the RPG program receives fromthe displ

Pagina 296

Valid WORKSTN File Operations ¹ No indicators are passed to or from the program.¹ No function key indicators are defined.¹ The record is written to

Pagina 297

Multiple-Device Files EXFMT OperationThe EXFMT operation is a combination of a WRITE followed by a READ to thesame record format (it corresponds t

Pagina 298

Multiple-Device Files operations. See the sections on inviting a program device in ICF Programmingmanual and Data Management manual.¹ The READ oper

Pagina 299 - File Locking

Multiple-Device Files ation to the ICF device, you do not need to modify the value again unless aninput operation completes successfully with a dif

Pagina 300 - Record Locking

Database Physical File Chapter 19. Example of an Interactive ApplicationThis chapter illustrates some common workstation applications and their ILE

Pagina 301 - Sharing an Open Data Path

AS/400 Tools Table 3. Commonly Used CL CommandsAction CL command ResultUsing System Menus GO MAIN Display main menuGO INFO Display help menuGO CM

Pagina 302 - Spooling

Main Menu Inquiry A***************************************************************** A* FILE NAME: CUSMST *A* RELATED PGMS: CUSMNT, SCHZIP, SCH

Pagina 303 - Output Spooling

Main Menu Inquiry A***************************************************************** A* FILE NAME: MAINMENU * A* RELATED PGMS: CUSMAIN *A* DES

Pagina 304 - SRTSEQ/ALTSEQ

Main Menu Inquiry ***************************************************************** * PROGRAM NAME: CUSMAIN ** RELATED FILES: MAINMENU (DSPF) **

Pagina 305 - Data Files and Source Files

File Maintenance  22:30:05 CUSTOMER MAIN INQUIRY 9/30/94Press one of the following PF keys.F3 End JobF5 Maintain Customer FileF6 Search Customer

Pagina 306 - Access Path

File Maintenance MNTMENU: DDS for a Display Device File A***************************************************************** A* FILE NAME: MNTMENU

Pagina 307

File Maintenance A MODE 8A O 1 4DSPATR(HI) A 1 13'MODE' A DSPATR(HI) A 2 4TIME A DSPATR(HI)A 2 28'CUSTOMER FILE MAINTENANCE&a

Pagina 308

File Maintenance Delete, and Display modes. The fields are defined as output/input (B in position38). The fields are protected when Display or Dele

Pagina 309

File Maintenance ********************************************************************* SUBROUTINE - ADDSUB ** PURPOSE - ADD NEW CUSTOMER TO FIL

Pagina 310 - Referring to a Partial Key

File Maintenance ********************************************************************* SUBROUTINE - DELSUB ** PURPOSE - DELETE CUSTOMER MASTER

Pagina 311 - AS/400 Reference

File Maintenance change the mode of processing by pressing F5 (ADD), F6 (UPDATE), F7(DELETE), or F8 (DISPLAY).To add a new record to the file, the

Pagina 312 - Indexed File

AS/400 Tools ¹ Define a flexible environment where production, testing, and maintenance canbe managed simultaneously¹ Organize several developers w

Pagina 313 - Exception/Error Handling

File Maintenance   DISPLAY MODE22:31:06 CUSTOMER FILE MAINTENANCE 9/30/94 Customer: 00007 Mikhail Yuri1001 Bay Street Suite 1702 Livonia M

Pagina 314 - Record Address File

File Maintenance   ADD MODE22:32:04 CUSTOMER FILE MAINTENANCE 9/30/94 Customer: 00012Name JUDAH GOULDAddress 2074 BATHURST AVENUE Address Ci

Pagina 315 - Relative Record Numbers

Search by Zip Code   UPDATE MODE22:33:17 CUSTOMER FILE MAINTENANCE 9/30/9400010 <--Enter Customer NumberF3 End Job F5 Add F6 Update F7 Delet

Pagina 316 - Consecutive Processing

Search by Zip Code SZIPMENU: DDS for a Display Device File A***************************************************************** A* FILE NAME: SZIP

Pagina 317 - Sequential-by-Key Processing

Search by Zip Code A 55 SFLCLR A N55 SFLDSPCTL A N55 SFLDSP A SFLSIZ(13) A SFLPAG(13)A ROLLUP(95 'ROLL UP') A OVERLAYA CA04(04 &ap

Pagina 318

Search by Zip Code SCHZIP: RPG Source ***************************************************************** * PROGRAM NAME: SCHZIP ** RELATED FILES:

Pagina 319

Search by Zip Code ********************************************************************* SUBROUTINE - SFLPRC ** PURPOSE - PROCESS SUBFILE AND D

Pagina 320 - This example is the

Search by Zip Code The zip code (ZIP) is used to position the CUSMSTL2 file by the SETLL operation.Notice that the record format name CMLREC2 is us

Pagina 321 - In this example, the

Search and Inquiry by Name  22:34:45 CUSTOMER SEARCH BY ZIP 9/30/94 Zip Code 11201 Customer Name A/R Balance Rick Coupland 300.00 Mikhail Yu

Pagina 322

Search and Inquiry by Name SNAMMENU: DDS for a Display Device File A 55 SFLCLR A N55 SFLDSPCTL A N55 SFLDSPA ROLLUP(95 'ROLL UP') A O

Pagina 323 - Random-by-Key Processing

AS/400 Tools ¹ Program verification— performs, at the workstation, the full range of syntax andsemantic checking that the compiler does, without ge

Pagina 324

Search and Inquiry by Name ¹ SFLDSPCTL indicates when to display the subfile-control record format (whenindicator 55 is off).¹ SFLDSP indicates whe

Pagina 325

Search and Inquiry by Name ******************************************************************** * MAINLINE * **********************************

Pagina 326

Search and Inquiry by Name ********************************************************************* SUBROUTINE - SFLCLR ** PURPOSE - CLEAR SUBFILE

Pagina 327

Search and Inquiry by Name ¹ To display customer detail by entering X, and pressing ENTER. The user canthen return to the PROMPT screen by pressing

Pagina 328 - Valid File Operations

Search and Inquiry by Name The detailed information for the customer selected is shown in Figure 192 onpage 370. At this point the user selects the

Pagina 329 - Valid File Operations

Appendixes Copyright IBM Corp. 1994, 1999 371

Pagina 330 - Valid File Operations

372 ILE RPG for AS/400 Programmer's Guide

Pagina 331 - Using Commitment Control

Differences Between OPM RPG/400 and ILE RPG Appendix A. Behavioral Differences Between OPM RPG/400and ILE RPG for AS/400The following lists note di

Pagina 332 - Commitment Control Scoping

Differences Between OPM RPG/400 and ILE RPG Running1. The FREE operation is not supported by RPG IV.2. Certain MCH messages may appear in the job

Pagina 333 - Using the COMMIT Operation

Differences Between OPM RPG/400 and ILE RPG 4. Call performance for LR-on will be greatly improved by having no PSDS, or aPSDS no longer than 80 by

Pagina 334 - Using Commitment Control

Note! Before using this information and the product it supports, be sure to read the general information under “Notices” on page xi.Third Editio

Pagina 335 - Using Commitment Control

AS/400 Tools 16 ILE RPG for AS/400 Programmer's Guide

Pagina 336 - DDM Files

Differences Between OPM RPG/400 and ILE RPG In ILE RPG, the total number of program devices that can be acquired by theprogram cannot be different

Pagina 337 - Using Pre-V3R1 DDM Files

Differences Between OPM RPG/400 and ILE RPG give different results than expected when DDS features are used that causemore than one search argument

Pagina 338 - DDM Files

Differences Between OPM RPG/400 and ILE RPG ¹ The user has not specified that a transparency check should be performedby the compilerIn ILE RPG, if

Pagina 339 - Types of Device Files

Conversion Overview Appendix B. Using the RPG III to RPG IV Conversion AidThe RPG IV source specification layouts differ significantly from the Sys

Pagina 340 - Handling Page Overflow

Conversion Overview File ConsiderationsThe Conversion Aid operates on file members. This section presents information ondifferent aspects of files

Pagina 341 - Accessing Printer Devices

Conversion Overview If the converted source file has a record length less than 92 characters then anerror message will be issued and the conversion

Pagina 342 - Accessing Printer Devices

Converting Your Source In addition to object-authority requirements, there may be additional storagerequirements. Each converted source program is,

Pagina 343

Converting Your Source 5. Check the log file or the error report for any errors. For more information, see“Analyzing Your Conversion” on page 393.6

Pagina 344

Converting Your Source ┌┐─*LIBL/──────── ┌ ┐─source-file-member-name── ─CVTRPGSRC─ ─FROMFILE──(─ ──┼ ┼─────────────── ─── ──source-file-name─

Pagina 345

Converting Your Source source-file-member-nameEnter the name of the source member to be converted.*ALLThe command converts all the members in the s

Pagina 346 - Specifying Fetch Overflow

RPG Programming in ILE Chapter 2. RPG Programming in ILEILE RPG is an implementation of the RPG IV programming language in the Inte-grated Language

Pagina 347

Converting Your Source the source members in the FROMFILE are converted. The convertedsource members have the same names as those of the original s

Pagina 348

Converting Your Source LOGFILESpecifies the name of the log file that is used to track the conversion informa-tion. Unless *NONE is specified, ther

Pagina 349 - Accessing Tape Devices

Converting Your Source Converting All Members in a FileYou can convert all of the members in a source physical file by specifyingFROMMBR(*ALL) and

Pagina 350 - Specifying a Sequential File

Converting Your Source Using the TOFILE(*NONE) parameter stops the Conversion Aid from generating aconverted member, but still allows it to produce

Pagina 351 - Using SPECIAL Files

Example of Source Conversion Converting Source Members with Embedded SQLWhen converting code that contains embedded SQL and the SQL code is con-tin

Pagina 352 - Using SPECIAL Files

Example of Source Conversion H TSTPGM FFILE1 IF E DISK COMM1 FQSYSPRT O F 132 OF LPRINTER LQSYSPRT 60FL 56OL E ARR1 3 3 1 COMM2 E ARR2 3 3

Pagina 353 - Using SPECIAL Files

Example of Source Conversion 1 ...H*unctions+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Comments+++++++++ 2 H DFTNAME(TSTPG

Pagina 354

Analyzing Your Conversion ¹ Record address file (RAF) entries on extension specifications have beenreplaced by the keyword RAFDATA on the File Desc

Pagina 355 - DDS Reference

Analyzing Your Conversion Using the Conversion ReportThe Conversion Aid generates a conversion report if you specify theCVTRPT(*YES) parameter on t

Pagina 356 - Output/input (both) fields

Analyzing Your Conversion 5769RG1 V4R4M0 990521 RN IBM ILE RPG AS400S01 12/30/99 20:41:35 Page 2From file . . . . . . . . . . . : MYLIB/QRPGSRC(REP

Pagina 357

RPG Programming in ILE Alternatively, you may create a program using separate commands for compilationand binding. This two-step process allows you

Pagina 358

Analyzing Your Conversion F i n a l S u m m a r y Message Totals:Information (00) . . . . . . . : 2Warning (10) . . . . . . . : 0Severe Error (30+

Pagina 359 - Using Subfiles

Analyzing Your Conversion A R QRNCVTFMA LGCENT 1A COLHDG('CVT' 'CENT')A TEXT('Conversion Century: 0-20th 1-+ A 21st&a

Pagina 360 - Reference

Resolving Conversion Problems Resolving Conversion ProblemsConversion problems may arise for one or more of the following reasons:¹ The RPG III sou

Pagina 361 - Use of Subfiles

Resolving Conversion Problems Merging ProblemsBecause of differences between the RPG III and RPG IV languages, the Conver-sion Aid must reorder ce

Pagina 362

Resolving Conversion Problems There are two methods of correcting this type of problem:1. Use the EXPCPY(*YES) option of the CVTRPGSRC command to i

Pagina 363 - Output Specifications

Resolving Conversion Problems ¹ In renaming an externally described data structure field or an externallydescribed file fieldI* If the RPG III sour

Pagina 364 - Additional Considerations

Resolving Conversion Problems Merging an Array with an Externally Described DS SubfieldAs mentioned earlier, you are not allowed to define a standa

Pagina 365 - Valid WORKSTN File Operations

Resolving Conversion Problems IDSONE E DSEXTREC I CHARACTER CHAR I I 'XYZ' CHAR C CHAR DSPLYC SETON LRFigure 210. RPG III sourc

Pagina 366 - Multiple-Device Files

Resolving Conversion Problems 404 ILE RPG for AS/400 Programmer's Guide

Pagina 367 - Multiple-Device Files

Reading Syntax Diagrams Appendix C. The Create CommandsThis section provides information on:¹ Using CL commands¹ Syntax diagram and description of

Pagina 368 - Multiple-Device Files

RPG Programming in ILE step process, see Chapter 7, “Creating a Program with the CRTRPGMOD andCRTPGM Commands” on page 73. For more information on

Pagina 369 - Database Physical File

CRTBNDRPG Command ──REQUIRED-PARAMETER──(─ ──┬ ┬─PREDEFINED-VALUE─── ─)───────────────────────────────────── └┘─user-defined-value── ──┬ ┬────

Pagina 370 - Main Menu Inquiry

CRTBNDRPG Command ─ ─CRTBNDRPG─ ──┬ ┬──────────────────────────────────────────────── ───────────────────────────────────────────────────── │

Pagina 371 - CUSMAIN: RPG Source

CRTBNDRPG Command OPTION Details: ┌ ┐─*XREF─── ┌ ┐─*GEN─── ┌ ┐─*NOSECLVL─ ┌ ┐─*SHOWCPY─── ┌ ┐─*EXPDDS─── ┌ ┐─*EXT─── ┌ ┐─*NOSHOWSKP─├─ ──┼ ┼

Pagina 372 - Main Menu Inquiry

CRTBNDRPG Command *LIBLThe system searches the library list to find the library where the source fileis stored. This is the default.*CURLIBThe curr

Pagina 373 - File Maintenance

CRTBNDRPG Command *YESWhen this program is called it will always run in the default activationgroup. The default activation group is the activation

Pagina 374 - File Maintenance

CRTBNDRPG Command *SHOWCPYShow source records of members included by the /COPY compiler direc-tive.*NOSHOWCPYDo not show source records of members

Pagina 375

CRTBNDRPG Command | *NODEBUGIO| Do not generate breakpoints for input and output specifications.*NOEVENTFDo not create an Event File for use by CoO

Pagina 376 - CUSMNT: RPG Source

CRTBNDRPG Command *ALLGenerates the listing, source and copy views for debugging the compiledprogram object. The information contained in the listi

Pagina 377

CRTBNDRPG Command CVTOPTSpecifies how the ILE RPG compiler handles date, time, timestamp, graphicdata types, and variable-length data types which a

Pagina 378

CRTBNDRPG Command library-nameEnter the name of the library where the sort sequence table is stored.LANGIDSpecifies the language identifier to be u

Pagina 379

RPG Programming in ILE procedure names are resolved at bind time (that is, when you create the program),static calls are faster than dynamic calls.

Pagina 380

CRTBNDRPG Command cific authority to the object. The authority can be altered for all users or forspecified users after the program is created with

Pagina 381

CRTBNDRPG Command *NOWhen numeric overflow is detected, a run time error is generated with errorcode RNX0103.FIXNBRSpecifies whether decimal data t

Pagina 382 - Search by Zip Code

CRTBNDRPG Command Valid values depend on the current version, release, and modification level,and they change with each new release. If you specify

Pagina 383 - Search by Zip Code

CRTBNDRPG Command *LIBLThe system searches the library list to find the library where the bindingdirectory is stored.*CURLIBThe current library for

Pagina 384 - Search by Zip Code

CRTRPGMOD Command condition-nameUp to 32 condition names can be specified. Each name can be up to 50characters long. The condition names will be co

Pagina 385 - SCHZIP: RPG Source

CRTRPGMOD Command ─ ─CRTRPGMOD─ ──┬ ┬────────────────────────────────────────────────── ─────────────────────────────────────────────────── │

Pagina 386

CRTRPGMOD Command OPTION Details: ┌ ┐─*XREF─── ┌ ┐─*GEN─── ┌ ┐─*NOSECLVL─ ┌ ┐─*SHOWCPY─── ┌ ┐─*EXPDDS─── ┌ ┐─*EXT─── ┌ ┐─*NOSHOWSKP─├─ ──┼ ┼

Pagina 387

Compiler Listings Appendix D. Compiler ListingsCompiler listings provide you with information regarding the correctness of yourcode with respect t

Pagina 388 - Search and Inquiry by Name

Compiler Listings Table 32 (Page 2 of 2). Sections of the Compiler Listing| Listing Section1| OPTION2| DescriptionCode generation errors3Erro

Pagina 389 - Search and Inquiry by Name

Compiler Listings | 5769RG1 V4R4M0 990521 RN IBM ILE RPG MYLIB/MYSRC .1a/ AS400S01 98/07/27 12:58:46 Page 1| Command ...: CRTBNDRPG| Iss

Pagina 390 - SCHNAM: RPG Source

RPG Programming in ILE ¹ CEEDOD – Decompose Operational DescriptorNote: You cannot use these or any other ILE bindable APIs from within a programc

Pagina 391

Compiler Listings Source SectionThe source section shows records that comprise the ILE RPG source specifica-tions. The root source member records

Pagina 392 - Search and Inquiry by Name

Compiler Listings | with the next sequence number in the listing: sequence number 001700. The three| intervening lines are assigned the SEU sequenc

Pagina 393

Compiler Listings | 5769RG1 V4R4M0 990521 RN IBM ILE RPG MYLIB/MYSRC AS400S01 98/07/28 14:21:00 Page 2| .1a/| Line <---------------------- Sou

Pagina 394

Compiler Listings | *--------------------------------------------------------------------------------------------* .4/ 1| * Data structure . . .

Pagina 395 - Appendixes

Compiler Listings | Line <---------------------- Source Specifications ----------------------------><---- Comments ----> Do Page Change

Pagina 396

Compiler Listings | Statement Number| Shows the statement number generated from the source ID| number and the SEU sequence number as follows:|stmt_

Pagina 397 - Compiling

Compiler Listings | A d d i t i o n a l D i a g n o s t i c M e s s a g e s| Msg id Sv Number Seq Message text| *RNF7066 00 8 000800 Record-Format

Pagina 398

Compiler Listings Compile-Time DataThe Compile-Time Data section includes information on ALTSEQ or NLSS tables,and on tables and arrays. In this e

Pagina 399

Compiler Listings Key Field InformationThe Key Field Information section shows information about key fields for eachkeyed file. It also shows infor

Pagina 400

Compiler Listings | C r o s s R e f e r e n c e| File and Record References:| File Device References (D=Defined)| Record| CUSTFILE DISK 8D|

Pagina 401 - DBCS Data in Character Fields

RPG Programming in ILE 22 ILE RPG for AS/400 Programmer's Guide

Pagina 402

Compiler Listings E x t e r n a l R e f e r e n c e sStatically bound procedures: Procedure References PROTOTYPED 2 2 PADDR_PROC 4 CALLB_PROC 6

Pagina 403 - Conversion Overview

Compiler Listings | F i n a l S u m m a r y| Message Totals:| Information (00) . . . . . . . : 20| Warning (10) . . . . . . . : 0| Error (20) . .

Pagina 404 - File Considerations

Compiler Listings 438 ILE RPG for AS/400 Programmer's Guide

Pagina 405 - The Log File

BibliographyFor additional information about topics related to ILERPG programming on the AS/400 system, refer to thefollowing IBM AS/400 publicati

Pagina 406 - Converting Your Source

embedded SQL statements. Contains examples ofSQL statements and a description of the interactiveSQL function. Describes common concepts andrules f

Pagina 407 - The CVTRPGSRC Command

¹ILE RPG for AS/400 Reference Summary,SX09-1315-01, provides information about the RPGIII and RPG IV programming language. Thismanual contains tabl

Pagina 408 - Converting Your Source

442 ILE RPG for AS/400 Programmer's Guide

Pagina 409 - Converting Your Source

IndexSpecial Characters/COPY statementconversion problems 389, 398COPY debug view 168in a conversion report 394table in compiler listing 432*CANCL

Pagina 410

arrayconversion problems 402displaying while debugging 202loading 403prerun-time arrays 403arrival sequence access path 282ATTR debug commanddefi

Pagina 411

call operations (continued)free-form call 133, 134query names of called procedures 149special routines 157using 133call stack 129, 218Call Stack E

Pagina 412 - Performing a Trial Conversion

OPM-Compatible Application Chapter 3. Program Creation StrategiesThere are many approaches you can take in creating programs using an ILE lan-guage

Pagina 413 - Obtaining Conversion Reports

CL commands (continued)DSPPGMREF 149End Debug (ENDDBG) 170module-related 80MONMSG 247program-related 85RCLACTGR 110RCLRSC 112reading syntax

Pagina 414 - Example of Source Conversion

control-record format, subfile 335Conversion AidSee converting to RPG IVconversion reportsobtaining 389sections of 394using 394conversion, analyz

Pagina 415

CRTPGM commandSee Create Program (CRTPGM) commandCRTRPGMOD commandSee Create RPG Module (CRTRPGMOD) commandCRTRPTPGM (create auto report program)

Pagina 416

debugging (continued)displaying fields as hexadecimal values 205displaying fields in character format 205displaying fields in UCS-2 format 206displ

Pagina 417 - Analyzing Your Conversion

DISK file (continued)program-described (continued)processing 291record-address file 290sequential file 290record-format specifications 282DISPLAY

Pagina 418 - Using the Conversion Report

EVAL debug command (continued)using 199event file for CODE/400 411examplescompilingbinding multiple modules 84OPM-compatible program 61program for

Pagina 419 - Analyzing Your Conversion

externally described file (continued)file description specifications for 265output specifications for 269overriding 267physical and logical files

Pagina 420 - Using the Log File

GGDDM 156generating a programSee compilingSee control specificationsGENLVL parameterCRTBNDRPG command 58, 409CRTRPGMOD command 74Get Descriptive I

Pagina 421

indicatorsSee also individual operation codesas error indicators 227displaying while debugging 204error 227function key (KA-KN, KP-KY)with WORKST

Pagina 422 - Unsupported RPG III Features

listing view, creating 168listing, binderas maintenance resource 86basic 100creating 85determining exports in service program 91sections of 85lis

Pagina 423 - Merging Problems

OPM-Compatible Application Example of OPM-Compatible ProgramFigure 6 shows the run-time view of a sample application where you might want anOPM-com

Pagina 424 - Context-Sensitive Problems

MODULE parameter 82CRTBNDRPG command 408CRTRPGMOD command 74multiple devices attached to application program 310multiple-device fileWORKSTN 342Nn

Pagina 425

overrides, file 267example 274general discussion 273, 304indicated in compiler listing 425overriding external description 267Ppage headings 64page

Pagina 426

processing methods (continued)sequential only 293, 304sequential-by-key 293sequential-within-limits 300WORKSTN file 335, 341programabnormal endi

Pagina 427 - Run-time Differences

program/procedure call (continued)recursive calls 130returning from a called program or procedure 152returning values 134returning without ending 1

Pagina 428

removing observability 88RENAME keyword 266renaming field names 266renaming fields 266renaming record-format names 266REPLACE parameterCRTBNDRPG c

Pagina 429 - Using CL Commands

service program (continued)binding with CRTBNDRPG 60changing 93creating 91example 94in advanced application 30reasons for using 91reclaiming res

Pagina 430 - CRTBNDRPG Command

specifying a return point 237specifying an activation group 110specifying error indicators 227specifying the format of compiler listing 64spooling

Pagina 431 - CRTBNDRPG Command

TtableSee also arraydisplaying while debugging 202table of parametersCRTBNDRPG command 58CRTRPGMOD command 74CVTRPGSRC command 383tape file 290TBRE

Pagina 432 - CRTBNDRPG Command

WORKSTN filedefinition 331examples 345externally describedprocessing 335externally-described 331file operation codes allowed with 341function

Pagina 433

ÉÂÔÙPart Number: 99H3778Program Number: 5769-RG1Printed in U.S.A. 99H3778SC09-2507-02

Pagina 434

ILE Program Using CRTBNDRPG Related InformationConverting to RPG IV “Converting Your Source” on page 382One-step creation process Chapter 6, “Crea

Pagina 435

ContentsNotices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiProgramming Interface Information ...

Pagina 436

ILE Program Using CRTBNDRPG Example of ILE Program Using CRTBNDRPGFigure 7 shows the run-time view of an application in which an ILE CL programcall

Pagina 437

ILE Application Using CRTRPGMOD with programs in different activation groups. If you want to share afile across activation groups, you must open it

Pagina 438

ILE Application Using CRTRPGMOD ¹ An advanced applicationThe effect of ILE is the same as described in “Effect of ILE” on page 26.You may want to r

Pagina 439

ILE Application Using CRTRPGMOD JobXY Activation GroupRPGRPG *MODULE(Y1)RPG *MODULE(Y2)RPG *MODULE(Y3)RPG *MODULE(Y4)*PGM(X)*PGM(Y)Figure 8. Sing

Pagina 440

ILE Application Using CRTRPGMOD JobY Activation GroupCL *MODULE(Y1)RPG *MODULE(Y2)C *MODULE(Y3)RPG *MODULE(Y4)*PGM(Y)Default Activation Group*PGM(Q

Pagina 441

A Strategy to Avoid JobXYZ Activation GroupCL *MODULE(X1)RPG *MODULE(X2)C *MODULE(Z1)CL *MODULE(Z2)*PGM(X)*SRVPGM(Y)*SRVPGM(Z)RPGFigure 10. Advan

Pagina 442

A Strategy to Avoid JobCL*PGM(X)RPGRPG*PGM(Y)*SRVPGM(Z)Default Activation GroupQILE Activation GroupFigure 11. Scenario to Avoid. An application

Pagina 443

Multiple Procedures Module Chapter 4. Creating an Application Using MultipleProceduresThe ability to code more than one procedure in an ILE RPG mod

Pagina 444 - CRTRPGMOD Command

Multiple Procedures Module Subprocedures offer another feature. You can pass parameters to a subprocedureby value, and you can call a subprocedure

Pagina 445 - CRTRPGMOD Command

Multiple Procedures Module ¹ The number and nature of the parameters¹ Which parameters must be passed, and which are optionally passed¹ Whether ope

Pagina 446 - CRTRPGMOD Command

A Strategy to Avoid ... 31Chapter 4. Creating an Application Using Multiple Procedures ... 33A Multiple Proce

Pagina 447 - Appendix D. Compiler Listings

Example of Module with Multiple Procedures In order to format the name and address properly, FmtCust calls NumToChar toconvert the customer number

Pagina 448 - Prologue

Example of Module with Multiple Procedures Open file, read record, writeoutput records, close filesSubprocedure to determine ifcustomer record is i

Pagina 449 - Compiler Listings

Example of Module with Multiple Procedures .1/ All subprocedures begin and end with procedure specifications..2/ After the Begin-Procedure specific

Pagina 450 - Source Section

Example of Module with Multiple Procedures *--------------------------------------------------------------** FmtCust formats CUSTNAME, CUSTNUM, S

Pagina 451

Example of Module with Multiple Procedures *=================================================================** Source for module CVTPROCS. This

Pagina 452 - Compiler Listings

Example of Module with Multiple Procedures The Entire ARRSRPT ProgramThe ARRSRPT program consists of two modules: ARRSRPT and CVTPROCS.Figure 21 sh

Pagina 453

Example of Module with Multiple Procedures *--------------------------------------------------------------** P R O T O T Y P E S *--------------

Pagina 454

Example of Module with Multiple Procedures * Body of procedure C *ISO MOVE DUEDATE DateDue C CurDate SUBDUR DateDue DaysLate:*DC IF DaysLate &g

Pagina 455

Example of Module with Multiple Procedures Sample output for the program ARRSRPT is shown in Figure 23 on page 44.Customer number: 00001ABC Electro

Pagina 456 - /COPY Member Table

Coding Considerations A*================================================================*A* FILE NAME : CUSTRPTA* RELATED PGMS : ARRSRPTA* DESCRI

Pagina 457 - Compile-Time Data

Changing the Optimization Level ... 87Removing Observability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

Pagina 458 - Cross-Reference Table

Coding Considerations Program Creation¹ If you specify that a module does not have a main procedure then you cannotuse the CRTBNDRPG command to cr

Pagina 459 - External References List

For Further Information The automatic storage that is associated with earlier invocations is unaffectedby later invocations. All invocations share

Pagina 460 - Final Summary

For Further Information Prototyped CallTopic SeeFree-form call “Using a Prototyped Call” on page 133General InformationILE RPG for AS/400 Referen

Pagina 461

Creating and Running an ILE RPG ApplicationThis section provides you with the information that is needed to create and run ILERPG programs. It desc

Pagina 462

50 ILE RPG for AS/400 Programmer's Guide

Pagina 463 - Bibliography

Chapter 5. Entering Source StatementsThis chapter provides the information you need to enter RPG source statements. Italso briefly describes the to

Pagina 464

Using SEU Using the Source Entry Utility (SEU)You can use the Source Entry Utility (SEU) to enter your source statements. SEUalso provides promptin

Pagina 465 - Bibliography 441

Using SEU   Columns . . . : 6 76 Edit MYLIB/QRPGLESRC SEU==> ___________________________________________________________ EMPRPT FMT H HKeyword

Pagina 466

Using SEU *===============================================================** MODULE NAME: EMPRPT* RELATED FILES: EMPMST (PHYSICAL FILE) * QSYSPR

Pagina 467 - Numerics

Using SQL Statements A*****************************************************************A* DESCRIPTION: This is the DDS for the physical file EMPM

Pagina 468 - See also

Using the Fixed-Form Call Operations ... 148Examples of CALL and CALLB ... 150Passing Parameters Using

Pagina 469 - (continued)

Using SQL Statements ...+...1...+...2...+...3...+...4...+...5...+...6...+...7.. CC (ILE RPG calculation operations) CC/EXEC SQL (the

Pagina 470

Using the CRTBNDRPG Command Chapter 6. Creating a Program with the CRTBNDRPGCommandThis chapter shows you how to create an ILE program using RPG IV

Pagina 471 - Index 447

Using the CRTBNDRPG Command command. For more information see Chapter 7, “Creating a Program withthe CRTRPGMOD and CRTPGM Commands” on page 73.You

Pagina 472

Using the CRTBNDRPG Command Table 5 (Page 2 of 2). CRTBNDRPG Parameters and Their Default Values Grouped by FunctionALWNULL(*NO) Determines i

Pagina 473 - Index 449

Using the CRTBNDRPG Command Figure 31 on page 60 shows the screen which appears after entering theabove command. Display Module Source Program: E

Pagina 474

Using the CRTBNDRPG Command Note: DFTACTGRP must be set to *NO in order for you to enter a value for theACTGRP and BNDDIR parameters.For more info

Pagina 475

Using the CRTBNDRPG Command *------------------------------------------------------------------------* * DESCRIPTION: This program creates a print

Pagina 476

Using a Compiler Listing Using a Compiler ListingThis section discusses how to obtain a listing and how to use it to help you:¹ Fix compilation err

Pagina 477 - Index 453

Using a Compiler Listing *SHOWSKPSource lines excluded by conditional compilation directives (appear insource section of listing)*EXPDDSKey field i

Pagina 478

Using a Compiler Listing ¹ Select one of the following time separators: *SYSVAL, *BLANK, colon (:),comma (,) or period (.)Anywhere a date or time f

Pagina 479

Displaying Attributes of a Field ... 210Equating a Name with a Field, Expression, or Command ... 210Source Debug

Pagina 480

Using a Compiler Listing Line <--------------------- Source Specifications ----------------------------------------------><---- Comments -

Pagina 481

Using a Compiler Listing Lists the start and end positions along with the literal text or field names. Usethis to check for errors in your output s

Pagina 482

Using a Compiler Listing Using Additional-Diagnostic MessagesThe Additional Diagnostic Messages section identifies errors which arise when oneor mo

Pagina 483 - Index 459

Using a Compiler Listing Coordinating Listing Options with Debug View OptionsCorrecting run-time errors often involves debugging a program. The fol

Pagina 484

Accessing the RETURNCODE Data Area ¹ *SHOWSKP allows you to see the statements that are ignored by the compileras a result of /IF, /ELSEIF, /ELSE,

Pagina 485

Accessing the RETURNCODE Data Area 131-140 Source file library name141-150 Source file member name151-160 Compiler listing file name161-170 Compile

Pagina 486

Accessing the RETURNCODE Data Area 72 ILE RPG for AS/400 Programmer's Guide

Pagina 487 - Index 463

Creating a Module Object Chapter 7. Creating a Program with the CRTRPGMOD andCRTPGM CommandsThe two-step process of program creation consists of co

Pagina 488

Creating a Module Object ¹ Reuse pieces of code. This generally results in smaller programs. Smaller pro-grams give you better performance and easi

Pagina 489

Creating a Module Object Table 6 (Page 2 of 2). CRTRPGMOD Parameters and Their Default Values Grouped by FunctionDEFINE(*NONE) Specifies cond

Commenti su questo manuale

Nessun commento