IBM AS/400 User Manual

Browse online or download User Manual for Software IBM AS/400. IBM AS/400 User's Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 489
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 0
AS/400e ÉÂÔ
ILE RPG for AS/400
Programmer's Guide
Version 4
SC09-2507-02
Page view 0
1 2 3 4 5 6 ... 488 489

Summary of Contents

Page 1 - Programmer's Guide

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

Page 2

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

Page 3

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

Page 4 - Third Edition (May 1999)

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

Page 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

Page 6

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

Page 7

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

Page 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

Page 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

Page 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

Page 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

Page 12

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

Page 13

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

Page 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

Page 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

Page 16

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

Page 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

Page 18 - How to Send Your Comments

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

Page 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

Page 20

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

Page 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

Page 22

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

Page 23 - About This Guide xxi

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

Page 24

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

Page 25 - ILE RPG Introduction

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

Page 26

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

Page 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

Page 28 - Cycle Programming

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

Page 29 - Indicators

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

Page 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 . . . . . . . . . . . . . .

Page 31 - 1 6 10 16

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

Page 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

Page 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

Page 34 - The Entire Source Program

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

Page 35

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

Page 36 - Interacting with the System

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

Page 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

Page 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

Page 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

Page 40

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

Page 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

Page 42 - RPG Programming in ILE

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

Page 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

Page 44 - Bindable APIs

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

Page 45 - Multithreaded Applications

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

Page 46

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

Page 47 - OPM-Compatible Application

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

Page 48 - Effect of ILE

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

Page 49 - Related Information

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

Page 50

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

Page 51

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

Page 52

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

Page 53

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

Page 54 - Advanced Application Scenario

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

Page 55 - A Strategy to Avoid

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

Page 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

Page 57 - Procedures

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

Page 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

Page 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

Page 60

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

Page 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

Page 62

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

Page 63

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

Page 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

Page 65 - The Entire ARRSRPT Program

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

Page 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

Page 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

Page 68 - Figure 24. DDS for CUSTFILE

xiv ILE RPG for AS/400 Programmer's Guide

Page 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

Page 70 - Subprocedure Considerations

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

Page 71 - Subprocedures

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

Page 72 - Prototyped Call

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

Page 73 - Concepts

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

Page 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

Page 75 - Development Manager

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

Page 76 - Using SEU

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

Page 77 - Using SEU

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

Page 78

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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 84

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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 93

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

Page 94

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

Page 95

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

Page 96

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

Page 97 - CRTPGM Commands

162 ILE RPG for AS/400 Programmer's Guide

Page 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

Page 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

Page 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

Page 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

Page 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

Page 103

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

Page 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

Page 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

Page 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

Page 107

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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 114

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

Page 115 - Service Program Overview

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

Page 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

Page 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

Page 118 - Sample Service Program

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

Page 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

Page 120 - Sample Service Program

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

Page 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

Page 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

Page 123

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

Page 124 - Sample Binder Listing

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

Page 125

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

Page 126

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

Page 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

Page 128 - CL Programming

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

Page 129

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

Page 130 - Figure 48. DDS for EMPRPT2

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

Page 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

Page 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

Page 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

Page 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

Page 135 - Managing Activation Groups

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

Page 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

Page 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

Page 138

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

Page 139

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

Page 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

Page 141

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

Page 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

Page 143

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

Page 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.

Page 145

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

Page 146

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

Page 147

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

Page 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

Page 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

Page 150

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

Page 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

Page 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

Page 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

Page 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

Page 155

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

Page 156

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

Page 157 - Using the CALLP Operation

xxii ILE RPG for AS/400 Programmer's Guide

Page 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

Page 159 - Parameter Passing Styles

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

Page 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

Page 161

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

Page 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

Page 163 - Omitting Parameters

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

Page 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

Page 165 - Using %PARMS

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

Page 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

Page 167

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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 174 - Examples of CALL and CALLB

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

Page 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

Page 176 - Normal End

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

Page 177 - Abnormal End

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

Page 178 - Returning from a Subprocedure

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

Page 179 - Using Bindable APIs

2 ILE RPG for AS/400 Programmer's Guide

Page 180 - Calling a Graphics Routine

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

Page 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

Page 182

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

Page 183

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

Page 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

Page 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

Page 186

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

Page 187 - The ILE Source Debugger

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

Page 188 - Debug Commands

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

Page 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

Page 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

Page 191 - Creating a Root Source View

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

Page 192 - Creating a Listing View

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

Page 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

Page 194

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

Page 195 - Setting Debug Options

250 ILE RPG for AS/400 Programmer's Guide

Page 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

Page 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

Page 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

Page 199 - Viewing a Different Module

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

Page 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

Page 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:¹

Page 202

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

Page 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

Page 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

Page 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

Page 206 - Condition

260 ILE RPG for AS/400 Programmer's Guide

Page 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

Page 208

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

Page 209 - procedure-name

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

Page 210

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

Page 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

Page 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 (

Page 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

Page 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

Page 215

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

Page 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

Page 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

Page 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

Page 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

Page 220 - Stepping Into Call Statements

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

Page 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

Page 222

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

Page 223

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

Page 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

Page 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

Page 226

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

Page 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

Page 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

Page 229

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

Page 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

Page 231

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

Page 232 - Changing the Value of Fields

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

Page 233

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

Page 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

Page 235 - DISPLAY EQUATE

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

Page 236

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

Page 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

Page 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

Page 239

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

Page 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 (

Page 241 - Exception Handling Overview

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

Page 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

Page 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

Page 244 - ILE RPG Exception Handling

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

Page 245 - Exception Handling Overview

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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 251 - ILE RPG for AS/400 Reference

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

Page 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

Page 253

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

Page 254

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

Page 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

Page 256

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

Page 257

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

Page 258

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

Page 259

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

Page 260

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

Page 261

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

Page 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

Page 263 - ILE Condition Handlers

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

Page 264 - ILE Condition Handlers

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

Page 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

Page 266

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

Page 267

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

Page 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

Page 269

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

Page 270

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

Page 271

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

Page 272

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

Page 273

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

Page 274

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

Page 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

Page 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

Page 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

Page 278

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

Page 279 - Example of a Formatted Dump

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

Page 280

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

Page 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.*..

Page 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

Page 283

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

Page 284

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

Page 285 - Chapter 14. Defining Files

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

Page 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

Page 287 - Types of File Descriptions

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

Page 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

Page 289

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

Page 290 - Ignoring Record Formats

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

Page 291

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

Page 292

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

Page 293 - Using Output Specifications

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

Page 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

Page 295 - Data Management

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

Page 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

Page 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

Page 298

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

Page 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

Page 300 - Record Locking

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

Page 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

Page 302 - Spooling

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

Page 303 - Output Spooling

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

Page 304 - SRTSEQ/ALTSEQ

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

Page 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

Page 306 - Access Path

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

Page 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

Page 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

Page 309

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

Page 310 - Referring to a Partial Key

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

Page 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

Page 312 - Indexed File

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

Page 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

Page 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

Page 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

Page 316 - Consecutive Processing

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

Page 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

Page 318

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

Page 319

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

Page 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

Page 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

Page 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

Page 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

Page 324

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

Page 325

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

Page 326

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

Page 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

Page 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

Page 329 - Valid File Operations

Appendixes Copyright IBM Corp. 1994, 1999 371

Page 330 - Valid File Operations

372 ILE RPG for AS/400 Programmer's Guide

Page 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

Page 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

Page 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

Page 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

Page 335 - Using Commitment Control

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

Page 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

Page 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

Page 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

Page 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

Page 340 - Handling Page Overflow

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

Page 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

Page 342 - Accessing Printer Devices

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

Page 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

Page 344

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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 353 - Using SPECIAL Files

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

Page 354

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

Page 355 - DDS Reference

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

Page 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

Page 357

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

Page 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+

Page 359 - Using Subfiles

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

Page 360 - Reference

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

Page 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

Page 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

Page 363 - Output Specifications

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

Page 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

Page 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

Page 366 - Multiple-Device Files

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

Page 367 - Multiple-Device Files

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

Page 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

Page 369 - Database Physical File

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

Page 370 - Main Menu Inquiry

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

Page 371 - CUSMAIN: RPG Source

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

Page 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

Page 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

Page 374 - File Maintenance

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

Page 375

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

Page 376 - CUSMNT: RPG Source

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

Page 377

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

Page 378

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

Page 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.

Page 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

Page 381

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

Page 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

Page 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

Page 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

Page 385 - SCHZIP: RPG Source

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

Page 386

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

Page 387

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

Page 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

Page 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

Page 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

Page 391

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

Page 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

Page 393

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

Page 394

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

Page 395 - Appendixes

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

Page 396

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

Page 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

Page 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

Page 399

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

Page 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|

Page 401 - DBCS Data in Character Fields

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

Page 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

Page 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) . .

Page 404 - File Considerations

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

Page 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

Page 406 - Converting Your Source

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

Page 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

Page 408 - Converting Your Source

442 ILE RPG for AS/400 Programmer's Guide

Page 409 - Converting Your Source

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

Page 410

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

Page 411

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

Page 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

Page 413 - Obtaining Conversion Reports

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

Page 414 - Example of Source Conversion

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

Page 415

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

Page 416

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

Page 417 - Analyzing Your Conversion

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

Page 418 - Using the Conversion Report

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

Page 419 - Analyzing Your Conversion

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

Page 420 - Using the Log File

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

Page 421

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

Page 422 - Unsupported RPG III Features

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

Page 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

Page 424 - Context-Sensitive Problems

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

Page 425

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

Page 426

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

Page 427 - Run-time Differences

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

Page 428

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

Page 429 - Using CL Commands

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

Page 430 - CRTBNDRPG Command

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

Page 431 - CRTBNDRPG Command

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

Page 432 - CRTBNDRPG Command

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

Page 433

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

Page 434

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

Page 435

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

Page 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

Page 437

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

Page 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

Page 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

Page 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

Page 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

Page 442

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

Page 443

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

Page 444 - CRTRPGMOD Command

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

Page 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

Page 446 - CRTRPGMOD Command

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

Page 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

Page 448 - Prologue

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

Page 449 - Compiler Listings

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

Page 450 - Source Section

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

Page 451

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

Page 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

Page 453

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

Page 454

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

Page 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

Page 456 - /COPY Member Table

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

Page 457 - Compile-Time Data

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

Page 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

Page 459 - External References List

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

Page 460 - Final Summary

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

Page 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

Page 462

50 ILE RPG for AS/400 Programmer's Guide

Page 463 - Bibliography

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

Page 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

Page 465 - Bibliography 441

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

Page 466

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

Page 467 - Numerics

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

Page 468 - See also

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

Page 469 - (continued)

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

Page 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

Page 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

Page 472

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

Page 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

Page 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

Page 475

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

Page 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

Page 477 - Index 453

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

Page 478

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

Page 479

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

Page 480

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

Page 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

Page 482

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

Page 483 - Index 459

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

Page 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,

Page 485

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

Page 486

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

Page 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

Page 488

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

Page 489

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

Comments to this Manuals

No comments