IBM AS/400 Using Files with, Program-Described, Example of Some Typical Relationships between

Page 288

Types of File Descriptions

¹Less maintenance activity when the file’s record format is changed. often update programs by changing the file’s record format and the piling the programs that use the files without changing any coding i program.

¹Improved documentation because programs using the same files use co

record-format and field names.

¹ Improved reliability.

If

level checking is specified, the RPG progr

the

user

if there

are

changes in the external description. See “L

on

page 270

for further

information.

If an externally described file (identified by an E in position 22 specification) is specified for the devices SEQ or SPECIAL, the RPG pro the field descriptions for the file, but the interface to the oper though the file were a program-described file. Externally described f specify device-dependent functions such as forms control for PRINTER fil because this information is already defined in the external descripti

Using Files with

External-Description

as

Program-Described

 

 

 

A

file created

from

external descriptions can

be

used

as a program-d

the program. To use

an externally described

file

as a

program-describ

1.Specify the file as program-described (F in position 22) in the f specification of the program.

2. Describe the fields in the records on the input or/and output sp the program.

At compile time, the compiler uses the field descriptions in the input specifications. It does not retrieve the external descriptions.

Example of Some Typical Relationships between

OS/400

Field-Level

Description of

a File

Programs and

OS/400

Record-Level

Description of

a File

Files

OS/400

Field-Level

Description of

a File

1RPG

Externally Described File (E in position 22)

2RPG

Program-Described File (F in position

22)- The compiler does not copy in field-level description

3RPG

Program-Described File (F in position 22)

4RPG

Externally Described File (E in position 22)

Figure 129. Typical Relationships between an RPG Program and Files on the AS/400 System

 

.1/

The program uses

the field-level description

of a file that is

 

the operating system. An externally described file is identifi

 

position 22 of the file description specifications. At compilat

 

compiler copies in

the external field-level

description.

264 ILE RPG for AS/400 Programmer's Guide

Image 288
Contents ÉÂÔ Page ÉÂÔ Third Edition May 1999 Contents SQL WithService Program ChapterVi ILE ExceptionWorking with Files and Devices ViiRPG FilesAppendixes ILECopy IndexDoes ApplyAny LawTrademarks and Service Programming Interface InformationMarks Trademarks Or se Marks OthersPage Xiv ILE RPG for AS/400 Programmers Guide About This Guide GuideWho Should Use This IIIHow to Send Your Comments Prerequisite and Related InformationWhat New This Release?UCS-2 RiscINZ*EXTDFT INZ*USERElement CCSID*GRAPH To this Guide ChangesSince For AS/400Xxii ILE RPG for AS/400 Programmers Guide ILE RPG Introduction Program creation strategiesILE RPG for AS/400 Programmers Guide RPG IV Specifications Control SpecificationsInput Specifications RPG IV OverviewThe.When You Let Compiler Provide Logic For Your Cycle ProgrammingSubprocedure logic IndicatorsFirst LastOperation Codes ProgramExample of an ILE RPG Example of an ILE RPG ProgramFile Description Specifications ProgramSecond file Output Specifications BonusChain EvalSubprocedure Heading Lines That Contain Constant String PayrollILE RPG NotEntire Source Program ReturnFqsysprt Printer Rate Bonus PAY10U 0 Value Not *IN99 EvalCommonly Used Control Language Commands Interacting with the SystemOS/400 System System LibrarySystem Offers Full Set Tools That You May find usef Application Development ManagerServices AS/400 ToolsILE R Overview of the RPG IV Programming15 Language AS/400 Tools RPG Programming in ILE Program CreationRPG Programming in ILE ILE RPG, ILE C, ILE CoboCRTSRVPGM, and Crtpgm commands. They can also Specified Language You can CreateProcedure Followed Zero Or more subprocedures Program ManagementProgram Call ILESource Debugging Bindable APIsWhile the progra Accesses Are Also Threadsafe Multithreaded ApplicationsAS/400 now supports multithreading. ILE Does Not DirectlyRPG Programming in ILE Program Creation Strategies Strategy 1 OPM-Compatible ApplicationMethod OPM-Compatible ApplicationExample of OPM-Compatible Program Effect of ILEILE Program Using Crtbndrpg Related InformationStrategy 2 ILE Program ILE Program Using Crtbndrpg Example of ILE Program Shows Run-time view Application in which an ILE CL pr CallsXYZ Although Actual Storage Not Deleted As itILE Application Using Crtrpgmod UsingStrategy 3 ILE Application Scenario Single-Language ILE ApplicationSingle-Language Application Using Crtrpgmod and Crtpgm Mixed-Language ILE Application ScenarioAdvanced Application Scenario Strategy to Avoid Strategy to AvoidActivation Group Creating an Application Using Multiple Procedures Multiple Procedures ModuleProcedures OverviewPrototyped Calls What a module mightLike with Multiple Dures ModuleUsing prototyped calls you can call with the same syntax FmtCust Name 100A AddressNumToChar Numparm 30P 0 ValueExample of Module with Order to format Name Address ProperlyMade Expression Shows Call MultipleExample of Module with Multiple Procedures DDSISO Move ElseProcedures That STATE, ZIPZIP Module Meaning that it consists only of subprocedurModule, by Coding Keyword on the control specificatiEntire Arrsrpt Program Fcustfile Disk Fcustrpt PrinterCopy QRPGLE,CVTPROCP IcustrecCallp EndsrFollowing About ArrsrptISO Move Duedate Return Else EndifDDS When Coding Module with multiple procedures You Will Want Coding ConsiderationsGeneral Considerations Coding ConsiderationsMain Procedure Considerations Subprocedure ConsiderationsContain a program entry procedure and only a Cannot Contain Bound Procedure CallsMain Procedures SubproceduresFor Further Information ForPrototyped Call For Further InformationApplication Running anILE RPG for AS/400 Programmers Guide Statements FileSource Creating a LibraryUsing the Source Entry Utility Using SEUEntry Utility IPC IpcxIPP IpprPress F3 Exit To the Exit display. Type Y Yes to save SavedUsing SQL Statements Using SQL StatementsStatements Calculation specification Start Your DB2 UDBReference for more Refer toADTS thefor AS/400 Source EntryUtilitymanual for Information about How SEU handles Statement Syntax CheckingCommand Using the Crtbndrpg CommandWith You can use the Crtbndrpg Command interactively Batch From Shows Their Default ValuesDebugged Using a Source View Program Type Creating a Program for Source DebuggingList Creates View similar Compiler listingBinding Creating a Program with StaticThis example you create Program Display Module SourceCommand Bnddir¹ Wrkjob ¹ Wrkoutq queue-nameDisk Fqsysprt Printer Chain Emprec Not *IN99Payroll Register Date Empname EmprateUsing a Compiler Listing Using a Compiler ListingListing Obtaining a CompilerCustomizing a Compiler Listing Customizing a Page HeadingCompiler Listing XrefLast Update Customizing the SpacingIndenting Structured Operations PAGE/LINEErrors ListingEither Create This Will Add Sec Level text to the messages listed MessageUsing In-Line Diagnostic Messages FLD2FLD1 SEUCorrecting Run-time Errors Using Additional-Diagnostic MessagesBrowsing a Compiler Listing Using SEU Source Entry UtilityUsing a Compiler Listing for Maintenance Expdds these are the defaultsCoordinating Listing Options with Debug View Options Specified, and in the column labeled as Sta MentArea DataAccessing the Returncode Data Area Accessing the Returncode Data Area Commands CreatingModule Object ChapterCommand Using the CrtrpgmodYou Create a Module using the Create Creating a Nomain Module RequestedCreates a compiler listing which Crtrpgmod MODULEMYLIB/TRANSSVC SRCFILEMYLIB/QRPGLESRC¹ Dspjob Then Select option Display4 spooledFiles Related Files N/A Related Source TransrptOther Endsl ReturnEndsl Creating a Module for Prototype for TransIncProd Prototype for ProdNameFtrnsdta Disk Fqsysprt Printer ItrnsrecQTY Related CL Commands RPG, mainthe procedureisAdditional Examples ModulesBinding Modules into a Program Binding Modules into a ProgramBinder Using CommandInto a CrtclmodGroup Export Concepts forModules TrptUsing a Binder Listing Using a Binder ListingChanging a Module or Program Changing a Module orUsing the Updpgm Command LevelRemoving Observability SizeReducing an Objects Changing a Changing a Module or Program Creating a Service Program Service Program OverviewService Program Overview Dspsrvpgm Payroll DETAIL*PROCEXP *DATAEXPStrategies for Creating Service Programs Creating a Service Program Using CrtsrvpgmCreating a Service Program Using CrtsrvpgmChanging a Service Program Service Program Using CrtsrvpgmSample Service Program Sample Service ProgramAPI Opdesc Const OPTIONS*VARSIZEOPTIONS*VARSIZE CeedodExsr EnddoBegsr Eval DIV MVRCreating the Service Program Parameters Crtsrvpgm commandStrpgmexp Signaturecvthex Export Symbolcvttohex Endpgmexp Input String Charactern Output Hex string Character2 * nBinding to a Program Create the program by typingCrtrpgmod MODULEMYLIB/CVTHEXPGM SRCFILEMYLIB/QRPGLESRC Call CvthexpgmCopy RPGGUIDE/QRPGLE,CVTHEXPR Clear CallpExcept ClearUpdating the Service Sample Binder ListingBasic Binder listing for Cvthexpgm Sample Service Program Running a Program Using the CL Call Command Running a Program UsingRunning a Program 103Passing Parameters using 106 shows DDS That is Referenced by the EMPRPT2 Source Application Running a Program From a Menu-Driven ApplicationRunning a Program From a Selecting Option Design menusYou Run Menu by Entering RpginqRPGCHG, or Rpgadd respectively Command Running a Program Using User-CreatedReplying to Run-Time Inquiry Messages Replying to Run-Time InquiryEnding an ILE Program GroupsManaging Activation Wheresequence-noManaging Activation Groups Specifying an ActivationGroup OFFDefault CompatibilityRunning in the OPM ActivationReclaim Resources Command Deleting an ActivationGroup Activation Groups SuchManaging the Default Heap Using RPG Operations Referenceto AbridgedManaging Dynamically-Allocated Storage INZ*NULLDsply AddName 40A AllocElem@ = next@ = *NULL Namelen = %len%trimrnameNull DOW Heap Storage Problems DeallocRPG procedure This Managing Your Own HeapBindable APIs Call SomepgmSeeAPI theReference DynarrayCopy Dynarri CeegtstCeecrhp Initalloc SubsallocReset DynainitADD Initalloc Enddo DynainitDynaset Export IfgtExsr Realloc Endif Eval Realloc BegsrElse ADD Subsalloc Enddo Endsr DynasetDynaget Export IfleGet Heap Storage CrtsrvpgmCalling Programs and Procedures Program/Procedure Call OverviewProgram/Procedure Call Overview 127Calling Procedures Calling ProgramsStatic Call Stack Call stackStack Recursive Calls Recursive calls are only allowed ForThat Most r Stack Entry is Bottom Parameter-Passing Considerations Recent CallerProgram/Procedure Call Overview Using the Callp Operation ¹ Subprocedures in the same moduleRPG Prototyped calls Are also Known CallpUsing a Prototyped Call Calling within an Expression31A 30PExamples of Free-Form Call Passing Prototyped ParametersParameter Passing Styles Passing by ReferencePassing by Value Figures belowPassing ExtprocdocalcDocalc Export DocalcUsing Operational Descriptors ILE CEE APICeetsta Extprocceetsta When Calling Procedure You may sometimes want Leave Out Par Omitting ParametersOPTIONS*OMIT OmitPassing *OMIT Leaving Out ParametersOPTIONS*OMIT*NOPASS API QcmdexcPassing Prototyped Parameters Checking for the Number PsdsCopy Fmtaddrp OPTIONS*NOPASS ConstEval Address = %TRIMRCSTREET# + + Trimrprovince ReturnBegsr Movel CheckEndif Endsr 144 OPTIONS*NOPASSCtdata 5P 0 DIM2 CtdataTo create PRTADDR, using the source in on page 144, typ Passing Less Data Than RequiredParameters To create the program, PRTADDR, typeOrder of Evaluation Interlanguage CallsEffect Interlanguage Calling ConsiderationsTo obtain Actual Returned value DCL &RET2 TYPE*CHAR LEN2 DCL &RET1 TYPE*CHAR LEN1Call Operations Fixed-FormUsing the Fixed-Form Call Operations For Callb onlyOperation Operation extender is Used With Passing Parameters Using Parm Examples of Call and CallbOperations OperationUsing the Plist Operation Fixed-Form Call OperationsPlist Returning from a Main Procedure ProcedureNormal End Returning from a CalledReturning from a Called Program or Procedure Abnormal EndEntry Parm operation is perfor Returning from a Subprocedure WithoutFor the AS/400 Reference RetuUsing Bindable APIs Returning using ILE BindableSubprocedure ends abnormally APIsExamples of Using Bindable APIs Calling a Graphics RoutineCalling a Graphics Routine CeeutxCalling Special Routines Multithreading ConsiderationsMultithreading Considerations TheGDDM Programming GuideHow to AcrossShare Data Example, consider the situation where two procedures Called Will Wait For MOD1 Unlock. Procedures NotHow To Avoid DeadlockConsiderations PROC1MOD2 MOD1Debugging and Exception Handling 161ILE RPG for AS/400 Programmers Guide Debugging Programs ILE Source DebuggerILE Source Debugger 163Debug Commands AttrEquate EvalTbreak ThreadWatch FindOrder Debug it using Preparing a Program for DebuggingPreparing a Program for SourceCreating a Root Source View Options On the Dbgview parameter for EitherCrtbndrpg PGMMYLIB/DEBUGEX SRCFILEMYLIB/QRPGLESRC Crtrpgmod MODULEMYLIB/DBGEX SRCFILEMYLIB/QRPGLESRCListing View ViewDbgview ModuleView Program for DebuggingStarting the ILE Source Starting the ILE Source DebuggerOPMSRC*NO Setting Debug Options Strdbg ExampleStart a Debug Session for the sample debug program Debugex IntoSET OPM source debug support field,Example of Adding a Service Example of Removing ILE Programs from a Debug SessionAdding/Removing Programs from a Debug Session Debug SessionViewing the Program Source Viewing the Program SourceCobol Lstdbg ILEViewing a Different DbgexLibl PGM Changing the View of a ModuleSeveral Different views CprocSetting and Removing Breakpoints Setting and Removing BreakpointsSpecified You Not Erate Breakpoints Specify OPTION*NODEBUGIOSetting and Removing With the source positioned at the line where the breakpointDebug Command to set a job breakpoint BreakpointsSetting an JobBreakpoint Setting and Removing Unconditional Thread Breakpoints Debug Command Sets a Thread breakpo Single CurrentDebug Greater Than Equal To oneJob BreakpointsExample of Setting a Conditional Job Breakpoint Using F13 LineConditional Breakpoint Work with Module BreakpointsCommand Setting a Conditional Job Breakpoint UsingBreak 128 when BigDate=1994-09-30 National Language Sort Sequence NlssControl Spec Tion Is not available Sort SequenceOn the debug command line One procedure per module,procedurethe -namecan EitherMain procedure or one of the subprocedures VariaThis Example Statement View Is used to Set Breakpoint For Set a breakpoint for Module WithSet Breakpoint For Module with Listing, typeSetting and Removing Conditional Thread Breakpoints Using the Work with Module Breakpoints DisplayProcedurevariables-name and statement-number Main Procedure ExitDebug Commands Setting and Removing Watch ConditionsRemoving All Job ConditionsCharacteristics of Watches DisplayProgram statemen You Debug One Job From AnotherSetting Watch Conditions On the debug command line, without any parametersWatch Salary¹ To specify a variable or expression to be watched, type Payroll ABC PGMPayroll Displaying Active Watches Removing Watch ConditionsEnddbg IPLExample of Setting a Watch Condition Example of Setting a Watch ConditionBlankDisplay Module Source Display as shown below. InsteadObject Stepping Through the Program ObjectStepping Through Over Into Subprocedures Stepping Over Call StatementsSubroutines You Can Stepping Into Call Statements Step IntoTIP F22 This example, you use F22 Step Into to step Into the OPMFrom Program DebugexThis example, you use F22 Step Into to Subpr Which Module InputParmStep completed at line Switch Displaying Data and ExpressionsElse On page 201 shows Use ConstUnexpected Results when Evaluating Variables Scalar Fields RPG DefinitionBased Fields Date, Time, Timestamp FieldsDisplaying the Contents of an Array Displaying the Contents of a TableDisplaying Data Structures Eval DS12Displaying Indicators Which is discussed BelowDisplaying Fields as Hexadecimal Values Character FormatData Displaying Variable-Length FieldsBy Pointers Displaying Null-Capable FieldsSTRING=%SUBSTRBIGDATE 1 4 = String = 1ABCD6Fields Changing the Value of Fields = AbcdefOr Command Equating a Name with a Field, Expression, or CommandDisplaying Attributes of a Field Equating a Name withFor Sample Source for Debug ExamplesExamples Program using Source 215, type Sample Source for Debug ExamplesTo create the program DEBUGEX, type First ModuleDIM3 Ctdata DS1Inzabcde DS2Occur DS2 Move Plist ParmCall Rpgpgm Dump Seton Else EvalEntry Plist Parm Dsply SetonSource for C Procedure cproc. cproc is called by Dbgex Handling Exceptions Exception Handling OverviewException Handling Overview 217Indicates That Severe error has been detected Program Procedure P1 is Contro BoundaryDescribes Status Work Being done by a program Call stException Message Active onDure will Only Handle Errors That Subprocedure ILE RPG Exception HandlingException Handling within Operation For OPM PGM CUsing Exception Handlers Using Exception HandlersException Handler Priority Nested ExceptionsFor other Types Messages Escape MessagePGM2 PRC1Example of Unhandled Function Check Operation as wellPGM1 PGM2, each Containing a procedurUsing RPG-Specific Handlers Optimization ConsiderationsFor More Information Optimization See Changing Level Built-in-functionsThis Section Provides Some Examples How to Use Each These R Infsr error Subroutines, on Exsr Operation Code InfdsExtender ILE RPG For AS/400 Reference providesUsing an Error Subroutine Program ErrorOperation. If Either Explicitly cUsing a File Error Infsr Subroutine INFSRPrdInfsr INFDSPrdInfds Disk Ftrnbacklg O Fprint PrinterPrdInfds PrdStatus StatusInfds Using a Program Error Subroutine Position Definition Specification EnterAfter Keyword Operation With Factor EntryParms Proc Body of Code Goes HerePssr Begsr Move GetinIf this is a divide-by-zero error, add 1 to the divisor If control reaches ENDSR, the procedure will failTAG DIV Try again Err =Exceptions Order Show how to avoid looping Within PssrWhich is designed to ge SubrouAfter the Else Move InlrElse ADD Specifying a Return Point OFLUsing a Condition Handler ILE Condition HandlersILE Condition Handlers Handlers132 Printer RpghdlrLIKECondTok Action 10I OutCondTok LIKECondTokShows Source For Procedure Is registered Procedure Parameters Include PointerCondition Handler Communication Area Which Contains PointerARR1 CeehdluProcptr NooptSDS Noopt ProcSubst Begsr CallpCancel Handlers 244Ceertx Ceeutx ILEProcedure to SubProc will not fail Pssr has a Return operation, so the call from the mainSubproc Pssrdsply Return EndsrINZ0 Static Callb Ceertx ParmParm Omit Select WhenRPG using Condition Handlers Enabled UsingCancel Hdlr Dsply Msg CanHdlr Likely Occur WithCondition Handler that Ignores CPF4906 Endif ReturnHandle information or warning messages, otherwise percolate MsgSev = WarningILE RPG for AS/400 Programmers Guide Using the Dump Operation Code Using the Dump Operation CodeObtaining a Dump Obtaining an ILE RPG Formatted DumpFormatted Dump ¹ If a Dump operation is bypassed By a Goto operation,Does not Occur Dump Example of a Formatted Dump QsplAgement DumpPart 1 of 2. Data section of Formatted Dump 125 Part Data section of Formatted Dump Beginning of user variables, listed in alphabetical order, Order Which they are defined GapsWorking with Files and Devices 259ILE RPG for AS/400 Programmers Guide Defining Files Associating Files with Input/Output Devices Associating Files with Input/Output Devices 261Compilation Time Certain Operation Device Dependent Device dependency Is thatOperation Code is Valid Only WriteNaming Files Types of File DescriptionsTypes of File Descriptions Using Files with Program-DescribedFiles Example of Some Typical Relationships betweenDefining Externally Described Files Defining Externally DescribedOPTION*EXPDDS Renaming Record-Format Names Ignoring Record FormatsRenaming Field Names Nbrofcharreplaced. FigureUsing Input Specifications Modify anDescription ExternalYou Then Fixed Name Specification Will Get Error Indicator RecordFiles Used Program This Example FieldUsing Output Specifications Level Checking For Character Fields zeroIs written ALLDefining Program-Described Files Data Management Operations and ILE RPG I/O OperationsRPG I/O Operations SEQ SpecialData Management Operations and ILE RPG I/O Operations DeleteFile Considerations Overriding and Redirecting File Input and OutputOverriding and Redirecting File Input and Output 273Input Output Input OutputExample of Redirecting FMT1File Locking File LockingData Management manual Program Can Chang Allocate ObjectRecord Locking Record LockingSee Using PathSharing an Open Data Control For More InformationSpooling SpoolingProgram Details System Open Options Allowed for Each Can SpecifyOutput Spooling Program VersusSRTSEQ/ALTSEQ Accessing Database FilesPhysical Files and Logical Files Data Files and SourceUsing Externally Described Disk Files Record Format SpecificationsAccess Path Using Externally Described Disk FilesContained Physical file CUSMSTP, which is Identified UniqueUnique Dstref Distribution Application Field Reference Basdat EdtcdeyCust Checkmf Addr ReffldnameValid Keys for a Record File DiskCity EdtcdejArguments Partial KeyReferring to Record Blocking and Unblocking Used,Using Program-Described Disk Files Using Program-Described Disk FilesIndexed File ValidKeyword specifies position 15 as the starting po Logical file ORDDTLL. For the two fieldsSequential File Record Address File10AIDISK Move Order KEY ChainMethods for Processing Disk Files Limits RecordsRelative Record Numbers Methods for Processing Disk FilesConsecutive Processing Subsequent Text Describes Each Method ProcessingADD Sequential-by-Key Processing Examples of Sequential-by-Key ProcessingDatabase Programming Database Programming manualExample, the employee master record Weekly hours workedYTDRPT1 Related Files EMPL1 FprintFEMPL1 Disk Iemprec IrcweekYTDRPT2 Related Files EMPL1 Setoff Read EMPL1 Goto Eofend Move Enum EmpnoSeton Endif Eofend TAG SetonFor Processing Disk Files Records Are Processed as Matching records WithADD Tothrs Totovt Setoff ADD Ehwrk TothrsSUB Enhrs Ovthrs ADD Ovthrs Totovt Seton Endif OprintRandom-by-Key Processing Example of Random-by-Key ProcessingEmstupd Descriptions NnhrsSequential-within-Limits Processing ChangeFchange Examples of Sequential-within-Limits Processing Disk FilesESWLIM1 Related Files Empmst LimitsFlimits Disk 3PIDISK KEYLOC1 FprintRelative-Record-Number Processing ESWLIM2 Related Files EmpmstFempmst Disk Fprint Valid File Operations Valid File OperationsZ/F Recno Using Commitment Control Using Commitment ControlStarting and Ending Commitment See theBackup and Recovery manual Commitment Control LocksAbridged for Using Files ForSpecifying Concepts,Example of Using Commitment Control ReceiverJournal This command calls the program Revise Update Mastrec TranrecControl Disk Commit FtransCycle DDM FilesDDM Files Pre-V3R1 DDM ReferDistributedto the DataDDM Files Accessing Types of Device Files ChapterAttached 315Accessing Printer Devices Accessing Printer DevicesSpecifying Printer Files Handling Page OverflowOverflow On an and notline,anoverflowthe linelineis Example of Printing Headings on Every Example of Printing a Field on EveryOANL2 AccountUsing the Fetch-Overflow Routine in Program-Described FilesOverf Overflow Printing Setting of the Overflow Indicator Fetch Overflow Example of Specifying Fetch OverflowChanging Forms Control FileOPM Prtctl data structure Values Contained First four subfields DatForms Accessing Tape Devices Accessing Tape DevicesPrint File Name Associated Data Structure isAccessing Display Devices Using Sequential FilesUsing Sequential Files OvrdbfUsing Special Files Using Special FilesFile Program nameError StatusDescription Example of Using a Special File Special PgmnameuserioFLD Spcl Plist Parm FLD1 Movel Hello Write Excptn Outbuf SetonAre Added To the end of the RPG-created Parameter list Program User-written routineUserio Using Workstn Files Using Externally Described Workstn FilesFunction ¹ Output On page 333 shows an example of the DDS for a display-devicRefdstref PromptOverlay DescrpSpecifying Function Key Indicators on Display Device Files Specifying Command Keys DisplayDevice Using Subfiles Processing an Externally Described Workstn FileField SfileUse of Subfiles You press Specified Function key During ReadName Search SFL TEXTSubfile RecordUsing Program-Described Workstn Files Using Program-Described Workstn FilesSubfil Using a Program-Described WithInput Specifications Calculation SpecificationsName FormatValid Workstn File Operations Input FileOutput File Combined FileExfmt Operation Read OperationWrite Operation Multiple-Device FilesIs updated DevidKeyword. This field Initialized Multiple-Device Files Example of an Interactive Application Database Physical FileDatabase Physical File 345Inquiry DDS for aDisplay Device Main Menu InquiryCusmain RPG Source Using Crtrpgmod Create Program By entering First option specifies that the first module in the listMain menu will appear as in on File Maintenance File MaintenanceCUSMSTL1 DDS for a LogicalDisplay DeviceMode 70DATE EdtcdeyEdtcdez Record Format contains Constant Customer File Maintenance Cusmnt RPG SourceSubroutine Addsub Purpose Addsub Begsr Cstkey Chain CMLREC1 Not *IN50 MoveElse Move OFF Move ADD Mode When Move Update Mode WhenMove Delete Mode When Move Display Mode Endsl MODE1 EndsrDisplay Mode Customer File MaintenanceCstinq 223021On page 357 a new customer is added to the Customer Mast 22310630/94 Customer 00007 223143ADD Mode Delete ModeBathurst Avenue Zip Search bySearch by Zip Code CodeSzipmenu Related Files CUSMSTL2File SZIPMENU. IT has REFCUSMSTL2 Printqsysprt IndaraIndicates when to display Subfile When Indicator 55 is Schzip RPG Source Write Subctl Move OFF Move OFFADD Zero Recnum Endsr File indicator 71 on th ZipRoutine Fills Subfile Record Read From Subfile Is written to the screen as shown in onSearch and Inquiry by Name Search and Inquiry by NameFor Database File Used This Program Defines one reco Identifies Name field Key FieldsDevice File Snammenu DDS for a DisplayFOOT2 SubfileRecords Using Subfiles Schnam RPG SourceThis Program Prompts the User for the Customer File by the Setll OPERATION. then IT DisplaysExample of an Interactive 367Application File Indicator On the Read operation File Record CountRecnum IncJudah Gould Inquiry by Name 233948 30/94 Customer 00012 NameGould YorktownAppendixes 371ILE RPG for AS/400 Programmers Guide RPG/400 ILE For AS/400Appendix DifferencesRunning Debugging and ExceptionRPG III Will issue the RNQ1222 inquiry Message RPG/400 Will IssueWill issue the RNQ1022 inquiry Message Will IssueCompiler Such Programs Will Get Compilation errors Dbcs Data in Character FieldsDifferences Between OPM RPG/400 Appendix B. Using Conversion Overview379 HurryFile Considerations File Record LengthLog File Conversion Aid Tool RequirementsUSE Wont Do Converting Your SourceConverting Your Source AidCvtrpgsrc Command Fromfile LiblCurlib FrommbrTofile QrpglesrcNone TombrExpcpy YESCvtrpt Seclvl YES InsrtplDefaults Converting a Member UsingSource Converting All Members in a File Performing a Trial ConversionConverting Some Members Cvtrpgsrc FROMFILEOLDRPG/QRPGSRC Frommbrpayroll TOFILE*NONEObtaining Conversion Reports Converting Auto ReportSource Members CVTRPT*NOInserting Specification Templates DataExample of Source Conversion Example of Source ConversionExample Source Conversion To convert this source, enterConverted source is shown in on ARR2 III specifications for ARR2. The Conversion Aid Analyzing Your ConversionAnalyzing Your Conversion DS1Using the Conversion Shows Command summary for a sample ConversionReport Conversion Aid generates a conversion report if you specifyYour Call PROG1Using the Log File Qrncvtfm Lgcent Colhdgcvt Cent Lgdate Colhdgcvt DateYmmdd Lgtime Colhdgcvt TimeResolving Conversion Problems Compilation Errors in Existing RPG III CodeUnsupported RPG III Features Use of the /COPYTEST1 Context-Sensitive Problems Records UsingMembers in the converted RPG IV source member CompCommand Or manually Correct Code After Conversion Use of ExternallyStructures CharWhen converted Merging an Array with an Externally Described DS SubfieldInitializing ExtrecRun-time Differences Behavior WithXYZ Dsone Extnameextrec CharResolving Conversion Problems Appendix C. The Create Commands Using CL CommandsHow to Interpret Syntax Diagrams Reading Syntax DiagramsCrtbndrpg Command Crtbndrpg CommandValues KEYWORDREQUIRED-VALUEAppendix C. The Create Commands407 Description of the Crtbndrpg Command PGMProgram-name SrcfileSrcmbr GenlvlText SrcmbrtxtOption NoxrefGEN NogenNoext ElseifEventf DbgviewStmt ListALL OutputPrint OptimizeCvtopt DatetimeGraphic VarcharLangid ReplaceUsrprf UserIssued ChangeUSE ExcludeFixnbr ZonedTgtrls PRVAlwnull InputonlyBnddir Binding-directory-nameUsrlibl ActgrpQile NEWCrtrpgmod Command Crtrpgmod CommandPrfdta NocolAppendix C. The Create Commands421 Description of the Crtrpgmod command UsrprfPF4 PF1Appendix D. Compiler Listings Compiler Listings423 Which was Compiled Using Compiler ListingReading a CrtbModule or Program Source memberCompiler options Indentation MarkSection EndifEject Listings Sequence Numbers RootPart 1 of 3. Sample Source Part of the Listing Part 2 of 3. Sample Source Part of the Listing 1a/ *NOSRCSTMT Source Heading Line NumberRuler Line Do NumberDiagnostic AdditionalOutput Buffer Positions Copy Member TableCompile-Time Data Total Number of Characters AlteredCharacter to be Altered Alternate SequenceKey Field Information Cross-Reference TableExternal References List DuedateMessage Summary Final SummaryCode Generation and Binding Errors N a L M M a R YCompiler Listings Bibliography 439Iddu ILE RPG ILE RPG for AS/400 Programmers Guide Special 443Characters See Ceeutx See AlsoILE Control-record format, subfile Create Program Dbcs Describing Dsppgmref Binder Listing 100 Exception Service Find See halt See file See last See long Plist Methods Qual OA-OG, OV SEU See DB2 Totc ILE RPG for AS/400 Programmers Guide Éâôù
Related manuals
Manual 104 pages 4.57 Kb Manual 516 pages 58.6 Kb