IBM AS/400 manual ILE RPG Introduction, Program creation strategies

Page 25

ILE RPG Introduction

Before using ILE RPG to create a program, you must know certain asp environment in which you will be using it. This part provides informati lowing topics that you should know:

¹

Overview

of

RPG IV

language

 

 

¹

Role of

Integrated

Language Environment components

in RPG programming

¹

Integrated

Language

Environment

program creation strategies

¹

Overview

of

coding

a module

with more than one

procedure and pro

 

calls

 

 

 

 

 

Copyright IBM Corp. 1994, 1999

1

Image 25
Contents ÉÂÔ Page ÉÂÔ Third Edition May 1999 Contents With SQLChapter Service ProgramException Vi ILEVii Working with Files and DevicesFiles RPGILE AppendixesIndex CopyApply DoesAny LawProgramming Interface Information Trademarks and ServiceMarks Trademarks Or se Marks OthersPage Xiv ILE RPG for AS/400 Programmers Guide Guide About This GuideWho Should Use This IIIPrerequisite and Related Information How to Send Your CommentsRelease? What New ThisUCS-2 RiscINZ*USER INZ*EXTDFTElement CCSID*GRAPH Changes To this GuideSince For AS/400Xxii ILE RPG for AS/400 Programmers Guide Program creation strategies ILE RPG IntroductionILE RPG for AS/400 Programmers Guide Control Specifications RPG IV SpecificationsInput Specifications RPG IV OverviewCycle Programming The.When You Let Compiler Provide Logic For YourIndicators Subprocedure logicFirst LastProgram Operation CodesExample of an ILE RPG Example of an ILE RPG ProgramProgram File Description SpecificationsSecond file Bonus Output SpecificationsChain EvalHeading Lines That Contain Constant String Payroll SubprocedureILE RPG NotReturn Entire Source ProgramFqsysprt Printer Bonus PAY Rate10U 0 Value Not *IN99 EvalInteracting with the System Commonly Used Control Language CommandsOS/400 System System LibraryApplication Development Manager System Offers Full Set Tools That You May find usefAS/400 Tools ServicesILE R Overview of the RPG IV Programming15 Language AS/400 Tools Program Creation RPG Programming in ILERPG Programming in ILE ILE RPG, ILE C, ILE CoboLanguage You can Create CRTSRVPGM, and Crtpgm commands. They can also SpecifiedProgram Management Procedure Followed Zero Or more subproceduresProgram Call ILEBindable APIs Source DebuggingWhile the progra Multithreaded Applications Accesses Are Also ThreadsafeAS/400 now supports multithreading. ILE Does Not DirectlyRPG Programming in ILE Strategy 1 OPM-Compatible Application Program Creation StrategiesMethod OPM-Compatible ApplicationEffect of ILE Example of OPM-Compatible ProgramRelated Information ILE Program Using CrtbndrpgStrategy 2 ILE Program Shows Run-time view Application in which an ILE CL pr Calls ILE Program Using Crtbndrpg Example of ILE ProgramXYZ Although Actual Storage Not Deleted As itUsing ILE Application Using CrtrpgmodStrategy 3 ILE Application Single-Language ILE Application ScenarioMixed-Language ILE Application Scenario Single-Language Application Using Crtrpgmod and CrtpgmAdvanced Application Scenario Strategy to Avoid Strategy to AvoidActivation Group Multiple Procedures Module Creating an Application Using Multiple ProceduresProcedures OverviewWhat a module might Prototyped CallsLike with Multiple Dures ModuleFmtCust Name 100A Address Using prototyped calls you can call with the same syntaxNumToChar Numparm 30P 0 ValueOrder to format Name Address Properly Example of Module withMade Expression Shows Call MultipleDDS Example of Module with Multiple ProceduresISO Move ElseProcedures STATE, ZIP ThatZIP Meaning that it consists only of subprocedur ModuleModule, by Coding Keyword on the control specificatiFcustfile Disk Fcustrpt Printer Entire Arrsrpt ProgramIcustrec Copy QRPGLE,CVTPROCPCallp EndsrArrsrpt Following AboutISO Move Duedate Return Else EndifDDS Coding Considerations When Coding Module with multiple procedures You Will WantGeneral Considerations Coding ConsiderationsSubprocedure Considerations Main Procedure ConsiderationsContain a program entry procedure and only a Cannot Contain Bound Procedure CallsSubprocedures Main ProceduresFor Further Information ForFor Further Information Prototyped CallRunning an ApplicationILE RPG for AS/400 Programmers Guide File StatementsSource Creating a LibraryUsing SEU Using the Source Entry UtilityEntry Utility Ipcx IPCIPP IpprSaved Press F3 Exit To the Exit display. Type Y Yes to saveUsing SQL Statements Using SQL StatementsStatements Calculation specification Start Your DB2 UDBRefer toADTS thefor AS/400 Source Entry Reference for moreUtilitymanual for Information about How SEU handles Statement Syntax CheckingUsing the Crtbndrpg Command CommandWith Shows Their Default Values You can use the Crtbndrpg Command interactively Batch FromCreating a Program for Source Debugging Debugged Using a Source View Program TypeList Creates View similar Compiler listingCreating a Program with Static BindingThis example you create Program Display Module SourceBnddir Command¹ Wrkjob ¹ Wrkoutq queue-nameChain Emprec Not *IN99 Disk Fqsysprt PrinterPayroll Register Date Empname EmprateUsing a Compiler Listing Using a Compiler ListingListing Obtaining a CompilerCustomizing a Page Heading Customizing a Compiler ListingCompiler Listing XrefCustomizing the Spacing Last UpdateIndenting Structured Operations PAGE/LINEListing ErrorsEither Create This Will Add Sec Level text to the messages listed MessageFLD2 Using In-Line Diagnostic MessagesFLD1 SEUUsing Additional-Diagnostic Messages Correcting Run-time ErrorsBrowsing a Compiler Listing Using SEU Source Entry UtilityExpdds these are the defaults Using a Compiler Listing for MaintenanceCoordinating Listing Options with Debug View Options Specified, and in the column labeled as Sta MentData AreaAccessing the Returncode Data Area Accessing the Returncode Data Area Creating CommandsModule Object ChapterUsing the Crtrpgmod CommandYou Create a Module using the Create Requested Creating a Nomain ModuleCreates a compiler listing which Crtrpgmod MODULEMYLIB/TRANSSVC SRCFILEMYLIB/QRPGLESRCThen Select option Display4 spooled ¹ DspjobFiles Related Files N/A Related Source TransrptEndsl Return OtherEndsl Prototype for TransInc Creating a Module forProd Prototype for ProdNameItrnsrec Ftrnsdta Disk Fqsysprt PrinterQTY RPG, mainthe procedureis Related CL CommandsAdditional Examples ModulesBinding Modules into a Program Binding Modules into a ProgramBinder Command UsingInto a CrtclmodGroup Concepts for ExportModules TrptUsing a Binder Listing Using a Binder ListingChanging a Module or Changing a Module or ProgramLevel Using the Updpgm CommandSize Removing ObservabilityReducing an Objects Changing a Changing a Module or Program Service Program Overview Creating a Service ProgramService Program Overview Dspsrvpgm Payroll DETAIL*PROCEXP *DATAEXPCreating a Service Program Using Crtsrvpgm Strategies for Creating Service ProgramsCreating a Service Program Using CrtsrvpgmService Program Using Crtsrvpgm Changing a Service ProgramSample Service Program Sample Service ProgramAPI Const OPTIONS*VARSIZE OpdescOPTIONS*VARSIZE CeedodEnddo ExsrBegsr Eval DIV MVRParameters Crtsrvpgm command Creating the Service ProgramStrpgmexp Signaturecvthex Export Symbolcvttohex Endpgmexp Input String Charactern Output Hex string Character2 * nCreate the program by typing Binding to a ProgramCrtrpgmod MODULEMYLIB/CVTHEXPGM SRCFILEMYLIB/QRPGLESRC Call CvthexpgmClear Callp Copy RPGGUIDE/QRPGLE,CVTHEXPRExcept ClearSample Binder Listing Updating the ServiceBasic Binder listing for Cvthexpgm Sample Service Program Running a Program Using Running a Program Using the CL Call CommandRunning a Program 103Passing Parameters using 106 shows DDS That is Referenced by the EMPRPT2 Source Running a Program From a Menu-Driven Application ApplicationRunning a Program From a Selecting Option Design menusRpginq You Run Menu by EnteringRPGCHG, or Rpgadd respectively Running a Program Using User-Created CommandReplying to Run-Time Inquiry Messages Replying to Run-Time InquiryGroups Ending an ILE ProgramManaging Activation Wheresequence-noSpecifying an Activation Managing Activation GroupsGroup OFFCompatibility DefaultRunning in the OPM ActivationDeleting an Activation Reclaim Resources CommandGroup Activation Groups SuchReferenceto Abridged Managing the Default Heap Using RPG OperationsINZ*NULL Managing Dynamically-Allocated StorageDsply Alloc AddName 40AElem@ = next@ Namelen = %len%trimrname = *NULLNull DOW Dealloc Heap Storage ProblemsManaging Your Own Heap RPG procedure ThisBindable APIs Call SomepgmDynarray SeeAPI theReferenceCeegtst Copy DynarriCeecrhp Subsalloc InitallocDynainit ResetADD Initalloc Enddo DynainitIfgt Dynaset ExportExsr Realloc Endif Eval Realloc BegsrEnddo Endsr Dynaset Else ADD SubsallocDynaget Export IfleCrtsrvpgm Get Heap StorageProgram/Procedure Call Overview Calling Programs and ProceduresProgram/Procedure Call Overview 127Calling Programs Calling ProceduresStatic Call stack Call StackStack Recursive calls are only allowed For Recursive CallsThat Most r Stack Entry is Bottom Recent Caller Parameter-Passing ConsiderationsProgram/Procedure Call Overview ¹ Subprocedures in the same module Using the Callp OperationRPG Prototyped calls Are also Known CallpCalling within an Expression Using a Prototyped Call31A 30PPassing Prototyped Parameters Examples of Free-Form CallParameter Passing Styles Passing by ReferenceFigures below Passing by ValueExtprocdocalc PassingDocalc Export DocalcILE CEE API Using Operational DescriptorsCeetsta Extprocceetsta Omitting Parameters When Calling Procedure You may sometimes want Leave Out ParOPTIONS*OMIT OmitLeaving Out Parameters Passing *OMITOPTIONS*OMIT*NOPASS API QcmdexcPsds Passing Prototyped Parameters Checking for the NumberOPTIONS*NOPASS Const Copy FmtaddrpEval Address = %TRIMRCSTREET# + + Trimrprovince ReturnCheck Begsr MovelEndif Endsr OPTIONS*NOPASS 144Ctdata 5P 0 DIM2 CtdataPassing Less Data Than Required To create PRTADDR, using the source in on page 144, typParameters To create the program, PRTADDR, typeInterlanguage Calls Order of EvaluationEffect Calling Considerations InterlanguageTo obtain Actual Returned value DCL &RET2 TYPE*CHAR LEN2 DCL &RET1 TYPE*CHAR LEN1Fixed-Form Call OperationsFor Callb only Using the Fixed-Form Call OperationsOperation Operation extender is Used With Examples of Call and Callb Passing Parameters Using ParmOperations OperationFixed-Form Call Operations Using the Plist OperationPlist Procedure Returning from a Main ProcedureNormal End Returning from a CalledAbnormal End Returning from a Called Program or ProcedureEntry Parm operation is perfor Without Returning from a SubprocedureFor the AS/400 Reference RetuReturning using ILE Bindable Using Bindable APIsSubprocedure ends abnormally APIsCalling a Graphics Routine Examples of Using Bindable APIsCalling a Graphics Routine CeeutxMultithreading Considerations Calling Special RoutinesMultithreading Considerations TheGDDM Programming GuideAcross How toShare Data Will Wait For MOD1 Unlock. Procedures Not Example, consider the situation where two procedures CalledHow To Avoid DeadlockPROC1 ConsiderationsMOD2 MOD1161 Debugging and Exception HandlingILE RPG for AS/400 Programmers Guide ILE Source Debugger Debugging ProgramsILE Source Debugger 163Attr Debug CommandsEquate EvalThread TbreakWatch FindPreparing a Program for Debugging Order Debug it usingPreparing a Program for SourceOptions On the Dbgview parameter for Either Creating a Root Source ViewCrtbndrpg PGMMYLIB/DEBUGEX SRCFILEMYLIB/QRPGLESRC Crtrpgmod MODULEMYLIB/DBGEX SRCFILEMYLIB/QRPGLESRCView Listing ViewDbgview ModuleProgram for Debugging ViewStarting the ILE Source Debugger Starting the ILE SourceOPMSRC*NO Strdbg Example Setting Debug OptionsStart a Debug Session for the sample debug program Debugex IntoOPM source debug support field, SETExample of Removing ILE Programs from a Debug Session Example of Adding a ServiceAdding/Removing Programs from a Debug Session Debug SessionViewing the Program Source Viewing the Program SourceCobol Lstdbg ILEDbgex Viewing a DifferentLibl PGM Module Changing the View of aSeveral Different views CprocSetting and Removing Breakpoints Setting and Removing BreakpointsSpecified You Not Erate Breakpoints Specify OPTION*NODEBUGIOWith the source positioned at the line where the breakpoint Setting and RemovingDebug Command to set a job breakpoint BreakpointsJob Setting anBreakpoint Debug Command Sets a Thread breakpo Single Current Setting and Removing Unconditional Thread BreakpointsDebug Greater Than Equal To oneBreakpoints JobLine Example of Setting a Conditional Job Breakpoint Using F13Conditional Breakpoint Work with Module BreakpointsSetting a Conditional Job Breakpoint Using CommandBreak 128 when BigDate=1994-09-30 National Language Sort Sequence NlssSort Sequence Control Spec Tion Is not availableOne procedure per module,procedurethe -namecan Either On the debug command lineMain procedure or one of the subprocedures VariaSet a breakpoint for Module With This Example Statement View Is used to Set Breakpoint ForSet Breakpoint For Module with Listing, typeUsing the Work with Module Breakpoints Display Setting and Removing Conditional Thread BreakpointsProcedurevariables-name and statement-number Main Procedure ExitSetting and Removing Watch Conditions Debug CommandsRemoving All Job ConditionsDisplay Characteristics of WatchesProgram statemen You Debug One Job From AnotherOn the debug command line, without any parameters Setting Watch ConditionsWatch SalaryPayroll ABC PGM ¹ To specify a variable or expression to be watched, typePayroll Removing Watch Conditions Displaying Active WatchesEnddbg IPLExample of Setting a Watch Condition Example of Setting a Watch ConditionBlankDisplay Module Source Display as shown below. InsteadStepping Through the Program Object ObjectStepping Through Stepping Over Call Statements Over Into SubproceduresSubroutines You Can Step Into Stepping Into Call StatementsTIP This example, you use F22 Step Into to step Into the OPM F22From Program DebugexInputParm This example, you use F22 Step Into to Subpr Which ModuleStep completed at line Displaying Data and Expressions SwitchElse Const On page 201 shows UseScalar Fields RPG Definition Unexpected Results when Evaluating VariablesBased Fields Date, Time, Timestamp FieldsDisplaying the Contents of a Table Displaying the Contents of an ArrayEval DS12 Displaying Data StructuresWhich is discussed Below Displaying IndicatorsCharacter Format Displaying Fields as Hexadecimal ValuesDisplaying Variable-Length Fields DataBy Pointers Displaying Null-Capable FieldsString = 1ABCD6 STRING=%SUBSTRBIGDATE 1 4 =Fields = Abcdef Changing the Value of FieldsEquating a Name with a Field, Expression, or Command Or CommandDisplaying Attributes of a Field Equating a Name withSample Source for Debug Examples ForExamples Sample Source for Debug Examples Program using Source 215, typeTo create the program DEBUGEX, type First ModuleDS1 DIM3 CtdataInzabcde DS2Plist Parm Occur DS2 MoveCall Rpgpgm Else Eval Dump SetonEntry Plist Parm Dsply SetonSource for C Procedure cproc. cproc is called by Dbgex Exception Handling Overview Handling ExceptionsException Handling Overview 217Program Procedure P1 is Contro Boundary Indicates That Severe error has been detectedDescribes Status Work Being done by a program Call stActive on Exception MessageILE RPG Exception Handling Dure will Only Handle Errors That SubprocedureException Handling within Operation For PGM C OPMUsing Exception Handlers Using Exception HandlersException Handler Priority Nested ExceptionsEscape Message For other Types MessagesPGM2 PRC1Operation as well Example of Unhandled Function CheckPGM1 PGM2, each Containing a procedurOptimization Considerations Using RPG-Specific HandlersFor More Information Optimization See Changing Level Built-in-functionsInfsr error Subroutines, on Exsr Operation Code Infds This Section Provides Some Examples How to Use Each These RExtender ILE RPG For AS/400 Reference providesProgram Error Using an Error SubroutineOperation. If Either Explicitly cUsing a File Error Infsr Subroutine Disk Ftrnbacklg O Fprint Printer INFSRPrdInfsr INFDSPrdInfdsPrdInfds PrdStatus StatusInfds Position Definition Specification Enter Using a Program Error SubroutineAfter Keyword Operation With Factor EntryProc Body of Code Goes Here ParmsPssr Begsr Move GetinIf control reaches ENDSR, the procedure will fail If this is a divide-by-zero error, add 1 to the divisorTAG DIV Try again Err =Pssr Exceptions Order Show how to avoid looping WithinWhich is designed to ge SubrouMove Inlr After the ElseElse ADD OFL Specifying a Return PointILE Condition Handlers Using a Condition HandlerILE Condition Handlers HandlersPrinter Rpghdlr 132LIKECondTok Action 10I OutCondTok LIKECondTokIs registered Procedure Parameters Include Pointer Shows Source For ProcedureCondition Handler Communication Area Which Contains PointerCeehdlu ARR1Noopt ProcptrSDS Noopt ProcBegsr Callp Subst244 Cancel HandlersCeertx Ceeutx ILEPssr has a Return operation, so the call from the main Procedure to SubProc will not failSubproc Pssrdsply Return EndsrCallb Ceertx Parm INZ0 StaticParm Omit Select WhenCondition Handlers Enabled Using RPG usingCancel Hdlr Dsply Msg CanHdlr Likely Occur WithEndif Return Condition Handler that Ignores CPF4906MsgSev = Warning Handle information or warning messages, otherwise percolateILE RPG for AS/400 Programmers Guide Using the Dump Operation Code Using the Dump Operation CodeObtaining a Dump Obtaining an ILE RPG Formatted Dump¹ If a Dump operation is bypassed By a Goto operation, Formatted DumpDoes not Occur Dump Qspl Example of a Formatted DumpDump AgementPart 1 of 2. Data section of Formatted Dump 125 Part Data section of Formatted Dump Order Which they are defined Gaps Beginning of user variables, listed in alphabetical order,259 Working with Files and DevicesILE RPG for AS/400 Programmers Guide Associating Files with Input/Output Devices Defining FilesAssociating Files with Input/Output Devices 261Operation Device Dependent Device dependency Is that Compilation Time CertainOperation Code is Valid Only WriteTypes of File Descriptions Naming FilesTypes of File Descriptions Program-Described Using Files withFiles Example of Some Typical Relationships betweenDefining Externally Described Defining Externally Described FilesOPTION*EXPDDS Ignoring Record Formats Renaming Record-Format NamesRenaming Field Names Nbrofcharreplaced. FigureModify an Using Input SpecificationsDescription ExternalIndicator Record You Then Fixed Name Specification Will Get ErrorFiles Used Program This Example FieldUsing Output Specifications For Character Fields zero Level CheckingIs written ALLData Management Operations and ILE RPG I/O Operations Defining Program-Described FilesRPG I/O Operations SEQ SpecialDelete Data Management Operations and ILE RPG I/O OperationsOverriding and Redirecting File Input and Output File ConsiderationsOverriding 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 LockingPath See UsingSharing an Open Data Control For More InformationSpooling SpoolingProgram Details System Open Options Allowed for Each Can SpecifyProgram Versus Output SpoolingSRTSEQ/ALTSEQ Database Files AccessingPhysical Files and Logical Files Data Files and SourceRecord Format Specifications Using Externally Described Disk FilesAccess Path Using Externally Described Disk FilesUnique Contained Physical file CUSMSTP, which is IdentifiedUnique Basdat Edtcdey Dstref Distribution Application Field ReferenceCust Checkmf Addr ReffldnameDisk Valid Keys for a Record FileCity EdtcdejPartial Key ArgumentsReferring to Used, Record Blocking and UnblockingUsing Program-Described Disk Files Using Program-Described Disk FilesIndexed File ValidLogical file ORDDTLL. For the two fields Keyword specifies position 15 as the starting poRecord Address File Sequential File10AIDISK Move Order KEY ChainLimits Records Methods for Processing Disk FilesRelative Record Numbers Methods for Processing Disk FilesSubsequent Text Describes Each Method Processing Consecutive ProcessingADD Examples of Sequential-by-Key Processing Sequential-by-Key ProcessingDatabase Programming Database Programming manualWeekly hours worked Example, the employee master recordFprint YTDRPT1 Related Files EMPL1FEMPL1 Disk Iemprec IrcweekSetoff Read EMPL1 Goto Eofend Move Enum Empno YTDRPT2 Related Files EMPL1Seton Endif Eofend TAG SetonRecords Are Processed as Matching records With For Processing Disk FilesADD Ehwrk Tothrs ADD Tothrs Totovt SetoffSUB Enhrs Ovthrs ADD Ovthrs Totovt Seton Endif OprintExample of Random-by-Key Processing Random-by-Key ProcessingEmstupd Descriptions NnhrsChange Sequential-within-Limits ProcessingFchange Disk Files Examples of Sequential-within-Limits ProcessingLimits ESWLIM1 Related Files EmpmstFlimits Disk 3PIDISK KEYLOC1 FprintESWLIM2 Related Files Empmst Relative-Record-Number ProcessingFempmst Disk Fprint Valid File Operations Valid File OperationsZ/F Recno Using Commitment Control Using Commitment ControlStarting and Ending Commitment Commitment Control Locks See theBackup and Recovery manualAbridged for Files For UsingSpecifying Concepts,Receiver Example of Using Commitment ControlJournal Update Mastrec Tranrec This command calls the program ReviseControl Disk Commit FtransDDM Files CycleDDM Files ReferDistributedto the Data Pre-V3R1 DDMDDM Files Types of Device Files Chapter AccessingAttached 315Accessing Printer Devices Accessing Printer DevicesSpecifying Printer Files Handling Page OverflowOverflow On an and notline,anoverflowthe linelineis Example of Printing a Field on Every Example of Printing Headings on EveryOANL2 AccountRoutine in Program-Described Files Using the Fetch-OverflowOverf Overflow Printing Setting of the Overflow Indicator Example of Specifying Fetch Overflow Fetch OverflowFile Changing Forms ControlOPM Prtctl data structure Dat Values Contained First four subfieldsForms Accessing Tape Devices Accessing Tape DevicesPrint File Name Associated Data Structure isUsing Sequential Files Accessing Display DevicesUsing Sequential Files OvrdbfUsing Special Files Using Special FilesFile Program nameStatus ErrorDescription Special Pgmnameuserio Example of Using a Special FileFLD Spcl Plist Parm FLD1 Movel Hello Write Excptn Outbuf SetonProgram User-written routine Are Added To the end of the RPG-created Parameter listUserio Using Externally Described Workstn Files Using Workstn FilesFunction On page 333 shows an example of the DDS for a display-devic ¹ OutputPrompt RefdstrefOverlay DescrpSpecifying Command Keys Display Specifying Function Key Indicators on Display Device FilesDevice Processing an Externally Described Workstn File Using SubfilesSfile FieldYou press Specified Function key During Read Use of SubfilesName Search SFL TEXTSubfile RecordUsing Program-Described Workstn Files Using Program-Described Workstn FilesSubfil With Using a Program-DescribedCalculation Specifications Input SpecificationsName FormatInput File Valid Workstn File OperationsOutput File Combined FileRead Operation Exfmt OperationWrite Operation Multiple-Device FilesDevid Is updatedKeyword. This field Initialized Multiple-Device Files Database Physical File Example of an Interactive ApplicationDatabase Physical File 345DDS for a InquiryDisplay Device Main Menu InquiryCusmain RPG Source First option specifies that the first module in the list Using Crtrpgmod Create Program By enteringMain menu will appear as in on File Maintenance File MaintenanceCUSMSTL1 DDS for a LogicalDevice Display70DATE Edtcdey ModeEdtcdez Cusmnt RPG Source Record Format contains Constant Customer File MaintenanceAddsub Begsr Cstkey Chain CMLREC1 Not *IN50 Move Subroutine Addsub PurposeElse Move OFF Move Update Mode When Move ADD Mode WhenMove Delete Mode When Move Display Mode Endsl MODE1 EndsrCustomer File Maintenance Display ModeCstinq 223021223106 On page 357 a new customer is added to the Customer Mast30/94 Customer 00007 223143Delete Mode ADD ModeBathurst Avenue Search by ZipSearch by Zip Code CodeRelated Files CUSMSTL2 SzipmenuFile SZIPMENU. IT has REFCUSMSTL2 Printqsysprt IndaraIndicates when to display Subfile When Indicator 55 is Schzip RPG Source Move OFF Write Subctl Move OFFADD Zero Recnum Endsr Zip File indicator 71 on thRoutine 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 FieldsSnammenu DDS for a Display Device FileFOOT2 SubfileSchnam RPG Source Records Using SubfilesThis Program Prompts the User for the Customer File by the Setll OPERATION. then IT DisplaysExample of an Interactive 367Application File Record Count File Indicator On the Read operationRecnum IncJudah Gould 233948 30/94 Customer 00012 Name Inquiry by NameGould Yorktown371 AppendixesILE RPG for AS/400 Programmers Guide For AS/400 RPG/400 ILEAppendix DifferencesDebugging and Exception RunningRPG III RPG/400 Will Issue Will issue the RNQ1222 inquiry MessageWill issue the RNQ1022 inquiry Message Will IssueDbcs Data in Character Fields Compiler Such Programs Will Get Compilation errorsDifferences Between OPM RPG/400 Conversion Overview Appendix B. Using379 HurryFile Record Length File ConsiderationsConversion Aid Tool Requirements Log FileUSE Converting Your Source Wont DoConverting Your Source AidCvtrpgsrc Command Libl FromfileCurlib FrommbrQrpglesrc TofileNone TombrYES ExpcpyCvtrpt Seclvl YES InsrtplConverting a Member Using DefaultsSource Performing a Trial Conversion Converting All Members in a FileConverting Some Members Cvtrpgsrc FROMFILEOLDRPG/QRPGSRC Frommbrpayroll TOFILE*NONEConverting Auto Report Obtaining Conversion ReportsSource Members CVTRPT*NOData Inserting Specification TemplatesExample of Source Conversion Example of Source ConversionTo convert this source, enter Example Source ConversionConverted source is shown in on ARR2 Analyzing Your Conversion III specifications for ARR2. The Conversion AidAnalyzing Your Conversion DS1Shows Command summary for a sample Conversion Using the ConversionReport Conversion Aid generates a conversion report if you specifyCall PROG1 YourUsing the Log File Lgdate Colhdgcvt Date Qrncvtfm Lgcent Colhdgcvt CentYmmdd Lgtime Colhdgcvt TimeCompilation Errors in Existing RPG III Code Resolving Conversion ProblemsUnsupported RPG III Features Use of the /COPYTEST1 Records Using Context-Sensitive ProblemsMembers in the converted RPG IV source member CompUse of Externally Command Or manually Correct Code After ConversionStructures CharMerging an Array with an Externally Described DS Subfield When convertedInitializing ExtrecBehavior With Run-time DifferencesXYZ Dsone Extnameextrec CharResolving Conversion Problems Using CL Commands Appendix C. The Create CommandsHow to Interpret Syntax Diagrams Reading Syntax DiagramsCrtbndrpg Command Crtbndrpg CommandValues KEYWORDREQUIRED-VALUEAppendix C. The Create Commands407 PGM Description of the Crtbndrpg CommandProgram-name SrcfileGenlvl SrcmbrText SrcmbrtxtNoxref OptionGEN NogenElseif NoextDbgview EventfStmt ListOutput ALLPrint OptimizeDatetime CvtoptGraphic VarcharReplace LangidUsrprf UserChange IssuedUSE ExcludeZoned FixnbrTgtrls PRVInputonly AlwnullBnddir Binding-directory-nameActgrp UsrliblQile NEWCrtrpgmod Command Crtrpgmod CommandPrfdta NocolAppendix C. The Create Commands421 Usrprf Description of the Crtrpgmod commandPF4 PF1Compiler Listings Appendix D. Compiler Listings423 Compiler Listing Which was Compiled UsingReading a CrtbSource member Module or ProgramCompiler options Indentation MarkEndif SectionEject Sequence Numbers Root ListingsPart 1 of 3. Sample Source Part of the Listing Part 2 of 3. Sample Source Part of the Listing Line Number 1a/ *NOSRCSTMT Source HeadingRuler Line Do NumberAdditional DiagnosticCopy Member Table Output Buffer PositionsTotal Number of Characters Altered Compile-Time DataCharacter to be Altered Alternate SequenceCross-Reference Table Key Field InformationDuedate External References ListFinal Summary Message SummaryN a L M M a R Y Code Generation and Binding ErrorsCompiler Listings 439 BibliographyIddu ILE RPG ILE RPG for AS/400 Programmers Guide 443 SpecialCharacters 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