IBM AS/400 manual Begsr Movel, Check, Endif Endsr

Page 167

Passing Prototyped Parameters

 

*=================================================================*

 

* SUBROUTINE: GetStreet#

 

 

 

 

 

* Get the character form of the street number, left-adjuste￿d

*

 

* and padded on the right with blanks.

 

 

*

 

*=================================================================*

C

GetStreet#

BEGSR

 

 

 

 

C

 

MOVEL

Street#

CStreet#

10

 

 

*-----------------------------------------------------------------

 

 

 

*

 

* Find the first non-zero.

 

 

 

*

 

*-----------------------------------------------------------------

 

 

 

*

C

'0'

CHECK

CStreet#

Non0

5 0

 

 

*-----------------------------------------------------------------

 

 

 

*

 

* If there was a non-zero, substring the number starting at

 

*

 

* non-zero.

 

 

 

 

*

 

*-----------------------------------------------------------------

 

 

 

*

C

 

IF

Non0 > 0

 

 

 

C

 

SUBST(P)

CStreet#:Non0 CStreet#

 

 

 

*-----------------------------------------------------------------

 

 

 

*

 

* If there was no non-zero, just use '0' as the street number.

*

 

*-----------------------------------------------------------------

 

 

 

*

C

 

ELSE

 

 

 

 

C

 

MOVEL(P)

'0'

CStreet#

 

 

C

 

ENDIF

 

 

 

 

C

 

ENDSR

 

 

 

 

Figure 68 (Part 2 of 2). Source for procedure FMTADDR

*=================================================================*

*Prototype for FMTADDR - format an address *=================================================================*

DFmtAddr

PR

 

D

addr

70

 

D

strno

5

0 CONST

D

st

20

CONST

D

cty

15

OPTIONS(*NOPASS) CONST

D

prov

15

OPTIONS(*NOPASS) CONST

 

 

Figure

69. Source for /COPY member with Prototype for Procedure FMTADDR

Figure 70 on page 144 shows the source for the procedure PRTADDR. Th cedure serves to illustrate the use of FMTADDR. For convenience, the dures which would each call FMTADDR are combined into this single proc Also, for the purposes of the example, the data is program-describe

Since PRTADDR is'three procedures-'in,-oneit must define three different address data structures. Similarly, there are three parts in the c tions, each one corresponding to programs at each stage. After printi address, the procedure PRTADDR ends.

Chapter 10. Calling Programs and Procedures143

Image 167
Contents ÉÂÔ Page ÉÂÔ Third Edition May 1999 Contents With SQLChapter Service ProgramException Vi ILEVii Working with Files and DevicesFiles RPGILE AppendixesIndex CopyLaw DoesApply AnyTrademarks Or se Marks Others Trademarks and ServiceProgramming Interface Information MarksPage Xiv ILE RPG for AS/400 Programmers Guide III About This GuideGuide Who Should Use ThisPrerequisite and Related Information How to Send Your CommentsRisc What New ThisRelease? UCS-2INZ*USER INZ*EXTDFTElement CCSID*GRAPH For AS/400 To this GuideChanges SinceXxii ILE RPG for AS/400 Programmers Guide Program creation strategies ILE RPG IntroductionILE RPG for AS/400 Programmers Guide RPG IV Overview RPG IV SpecificationsControl Specifications Input SpecificationsCycle Programming The.When You Let Compiler Provide Logic For YourLast Subprocedure logicIndicators FirstExample of an ILE RPG Program Operation CodesProgram Example of an ILE RPGSecond file File Description SpecificationsProgram Eval Output SpecificationsBonus ChainNot SubprocedureHeading Lines That Contain Constant String Payroll ILE RPGFqsysprt Printer Entire Source ProgramReturn Not *IN99 Eval RateBonus PAY 10U 0 ValueSystem Library Commonly Used Control Language CommandsInteracting with the System OS/400 SystemApplication Development Manager System Offers Full Set Tools That You May find usefILE R ServicesAS/400 Tools Overview of the RPG IV Programming15 Language AS/400 Tools ILE RPG, ILE C, ILE Cobo RPG Programming in ILEProgram Creation RPG Programming in ILELanguage You can Create CRTSRVPGM, and Crtpgm commands. They can also SpecifiedILE Procedure Followed Zero Or more subproceduresProgram Management Program CallWhile the progra Source DebuggingBindable APIs Does Not Directly Accesses Are Also ThreadsafeMultithreaded Applications AS/400 now supports multithreading. ILERPG Programming in ILE OPM-Compatible Application Program Creation StrategiesStrategy 1 OPM-Compatible Application MethodEffect of ILE Example of OPM-Compatible ProgramStrategy 2 ILE Program ILE Program Using CrtbndrpgRelated Information Although Actual Storage Not Deleted As it ILE Program Using Crtbndrpg Example of ILE ProgramShows Run-time view Application in which an ILE CL pr Calls XYZStrategy 3 ILE Application ILE Application Using CrtrpgmodUsing 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 Overview Creating an Application Using Multiple ProceduresMultiple Procedures Module ProceduresModule Prototyped CallsWhat a module might Like with Multiple DuresNumparm 30P 0 Value Using prototyped calls you can call with the same syntaxFmtCust Name 100A Address NumToCharMultiple Example of Module withOrder to format Name Address Properly Made Expression Shows CallElse Example of Module with Multiple ProceduresDDS ISO MoveProcedures ZIP ThatSTATE, ZIP Keyword on the control specificati ModuleMeaning that it consists only of subprocedur Module, by CodingFcustfile Disk Fcustrpt Printer Entire Arrsrpt ProgramEndsr Copy QRPGLE,CVTPROCPIcustrec CallpReturn Else Endif Following AboutArrsrpt ISO Move DuedateDDS Coding Considerations When Coding Module with multiple procedures You Will WantCoding Considerations General ConsiderationsCannot Contain Bound Procedure Calls Main Procedure ConsiderationsSubprocedure Considerations Contain a program entry procedure and only aFor Main ProceduresSubprocedures For Further InformationFor Further Information Prototyped CallRunning an ApplicationILE RPG for AS/400 Programmers Guide Creating a Library StatementsFile SourceEntry Utility Using the Source Entry UtilityUsing SEU Ippr IPCIpcx IPPSaved Press F3 Exit To the Exit display. Type Y Yes to saveDB2 UDB Using SQL StatementsUsing SQL Statements Statements Calculation specification Start YourStatement Syntax Checking Reference for moreRefer toADTS thefor AS/400 Source Entry Utilitymanual for Information about How SEU handlesWith CommandUsing the Crtbndrpg Command Shows Their Default Values You can use the Crtbndrpg Command interactively Batch FromCreates View similar Compiler listing Debugged Using a Source View Program TypeCreating a Program for Source Debugging ListDisplay Module Source BindingCreating a Program with Static This example you create Program¹ Wrkoutq queue-name CommandBnddir ¹ WrkjobEmpname Emprate Disk Fqsysprt PrinterChain Emprec Not *IN99 Payroll Register DateObtaining a Compiler Using a Compiler ListingUsing a Compiler Listing ListingXref Customizing a Compiler ListingCustomizing a Page Heading Compiler ListingPAGE/LINE Last UpdateCustomizing the Spacing Indenting Structured OperationsThis Will Add Sec Level text to the messages listed Message ErrorsListing Either CreateSEU Using In-Line Diagnostic MessagesFLD2 FLD1Source Entry Utility Correcting Run-time ErrorsUsing Additional-Diagnostic Messages Browsing a Compiler Listing Using SEUSpecified, and in the column labeled as Sta Ment Using a Compiler Listing for MaintenanceExpdds these are the defaults Coordinating Listing Options with Debug View OptionsData AreaAccessing the Returncode Data Area Accessing the Returncode Data Area Chapter CommandsCreating Module ObjectYou Create a Module using the Create CommandUsing the Crtrpgmod Crtrpgmod MODULEMYLIB/TRANSSVC SRCFILEMYLIB/QRPGLESRC Creating a Nomain ModuleRequested Creates a compiler listing whichRelated Files N/A Related Source Transrpt ¹ DspjobThen Select option Display4 spooled FilesEndsl OtherEndsl Return Prototype for ProdName Creating a Module forPrototype for TransInc ProdQTY Ftrnsdta Disk Fqsysprt PrinterItrnsrec Modules Related CL CommandsRPG, mainthe procedureis Additional ExamplesBinder Binding Modules into a ProgramBinding Modules into a Program Crtclmod UsingCommand Into aGroup Trpt ExportConcepts for ModulesUsing a Binder Listing Using a Binder ListingChanging a Module or Changing a Module or ProgramLevel Using the Updpgm CommandReducing an Objects Removing ObservabilitySize Changing a Changing a Module or Program Dspsrvpgm Payroll DETAIL*PROCEXP *DATAEXP Creating a Service ProgramService Program Overview Service Program OverviewUsing Crtsrvpgm Strategies for Creating Service ProgramsCreating a Service Program Using Crtsrvpgm Creating a Service ProgramService Program Using Crtsrvpgm Changing a Service ProgramAPI Sample Service ProgramSample Service Program Ceedod OpdescConst OPTIONS*VARSIZE OPTIONS*VARSIZEDIV MVR ExsrEnddo Begsr EvalInput String Charactern Output Hex string Character2 * n Creating the Service ProgramParameters Crtsrvpgm command Strpgmexp Signaturecvthex Export Symbolcvttohex EndpgmexpCall Cvthexpgm Binding to a ProgramCreate the program by typing Crtrpgmod MODULEMYLIB/CVTHEXPGM SRCFILEMYLIB/QRPGLESRCClear Copy RPGGUIDE/QRPGLE,CVTHEXPRClear Callp ExceptSample Binder Listing Updating the ServiceBasic Binder listing for Cvthexpgm Sample Service Program 103 Running a Program Using the CL Call CommandRunning a Program Using Running a ProgramPassing Parameters using 106 shows DDS That is Referenced by the EMPRPT2 Source Selecting Option Design menus ApplicationRunning a Program From a Menu-Driven Application Running a Program From aRPGCHG, or Rpgadd respectively You Run Menu by EnteringRpginq Replying to Run-Time Inquiry CommandRunning a Program Using User-Created Replying to Run-Time Inquiry MessagesWheresequence-no Ending an ILE ProgramGroups Managing ActivationOFF Managing Activation GroupsSpecifying an Activation GroupActivation DefaultCompatibility Running in the OPMActivation Groups Such Reclaim Resources CommandDeleting an Activation GroupReferenceto Abridged Managing the Default Heap Using RPG OperationsDsply Managing Dynamically-Allocated StorageINZ*NULL Elem@ = next@ AddName 40AAlloc Namelen = %len%trimrname = *NULLNull DOW Dealloc Heap Storage ProblemsCall Somepgm RPG procedure ThisManaging Your Own Heap Bindable APIsDynarray SeeAPI theReferenceCeecrhp Copy DynarriCeegtst Subsalloc InitallocEnddo Dynainit ResetDynainit ADD InitallocRealloc Begsr Dynaset ExportIfgt Exsr Realloc Endif EvalIfle Else ADD SubsallocEnddo Endsr Dynaset Dynaget ExportCrtsrvpgm Get Heap Storage127 Calling Programs and ProceduresProgram/Procedure Call Overview Program/Procedure Call OverviewStatic Calling ProceduresCalling Programs Stack Call StackCall stack That Most r Stack Entry is Bottom Recursive CallsRecursive calls are only allowed For Recent Caller Parameter-Passing ConsiderationsProgram/Procedure Call Overview Callp Using the Callp Operation¹ Subprocedures in the same module RPG Prototyped calls Are also Known30P Using a Prototyped CallCalling within an Expression 31APassing by Reference Examples of Free-Form CallPassing Prototyped Parameters Parameter Passing StylesFigures below Passing by ValueDocalc PassingExtprocdocalc Docalc ExportCeetsta Extprocceetsta Using Operational DescriptorsILE CEE API Omit When Calling Procedure You may sometimes want Leave Out ParOmitting Parameters OPTIONS*OMIT API Qcmdexc Passing *OMIT Leaving Out Parameters OPTIONS*OMIT*NOPASSPsds Passing Prototyped Parameters Checking for the NumberTrimrprovince Return Copy FmtaddrpOPTIONS*NOPASS Const Eval Address = %TRIMRCSTREET# + +Endif Endsr Begsr MovelCheck 5P 0 DIM2 Ctdata 144OPTIONS*NOPASS CtdataTo create the program, PRTADDR, type To create PRTADDR, using the source in on page 144, typPassing Less Data Than Required ParametersEffect Order of EvaluationInterlanguage Calls DCL &RET2 TYPE*CHAR LEN2 DCL &RET1 TYPE*CHAR LEN1 InterlanguageCalling Considerations To obtain Actual Returned valueFixed-Form Call OperationsOperation Operation extender is Used With Using the Fixed-Form Call OperationsFor Callb only Operation Passing Parameters Using ParmExamples of Call and Callb OperationsPlist Using the Plist OperationFixed-Form Call Operations Returning from a Called Returning from a Main ProcedureProcedure Normal EndEntry Parm operation is perfor Returning from a Called Program or ProcedureAbnormal End Retu Returning from a SubprocedureWithout For the AS/400 ReferenceAPIs Using Bindable APIsReturning using ILE Bindable Subprocedure ends abnormallyCeeutx Examples of Using Bindable APIsCalling a Graphics Routine Calling a Graphics RoutineTheGDDM Programming Guide Calling Special RoutinesMultithreading Considerations Multithreading ConsiderationsShare Data How toAcross To Avoid Deadlock Example, consider the situation where two procedures CalledWill Wait For MOD1 Unlock. Procedures Not HowMOD1 ConsiderationsPROC1 MOD2161 Debugging and Exception HandlingILE RPG for AS/400 Programmers Guide 163 Debugging ProgramsILE Source Debugger ILE Source DebuggerEval Debug CommandsAttr EquateFind TbreakThread WatchSource Order Debug it usingPreparing a Program for Debugging Preparing a Program forCrtrpgmod MODULEMYLIB/DBGEX SRCFILEMYLIB/QRPGLESRC Creating a Root Source ViewOptions On the Dbgview parameter for Either Crtbndrpg PGMMYLIB/DEBUGEX SRCFILEMYLIB/QRPGLESRCModule Listing ViewView DbgviewProgram for Debugging ViewOPMSRC*NO Starting the ILE SourceStarting the ILE Source Debugger Into Setting Debug OptionsStrdbg Example Start a Debug Session for the sample debug program DebugexOPM source debug support field, SETDebug Session Example of Adding a ServiceExample of Removing ILE Programs from a Debug Session Adding/Removing Programs from a Debug SessionLstdbg ILE Viewing the Program SourceViewing the Program Source CobolLibl PGM Viewing a DifferentDbgex Cproc Changing the View of aModule Several Different viewsOPTION*NODEBUGIO Setting and Removing BreakpointsSetting and Removing Breakpoints Specified You Not Erate Breakpoints SpecifyBreakpoints Setting and RemovingWith the source positioned at the line where the breakpoint Debug Command to set a job breakpointBreakpoint Setting anJob Greater Than Equal To one Setting and Removing Unconditional Thread BreakpointsDebug Command Sets a Thread breakpo Single Current DebugBreakpoints JobWork with Module Breakpoints Example of Setting a Conditional Job Breakpoint Using F13Line Conditional BreakpointNational Language Sort Sequence Nlss CommandSetting a Conditional Job Breakpoint Using Break 128 when BigDate=1994-09-30Sort Sequence Control Spec Tion Is not availableVaria On the debug command lineOne procedure per module,procedurethe -namecan Either Main procedure or one of the subproceduresListing, type This Example Statement View Is used to Set Breakpoint ForSet a breakpoint for Module With Set Breakpoint For Module withMain Procedure Exit Setting and Removing Conditional Thread BreakpointsUsing the Work with Module Breakpoints Display Procedurevariables-name and statement-numberConditions Debug CommandsSetting and Removing Watch Conditions Removing All JobYou Debug One Job From Another Characteristics of WatchesDisplay Program statemenSalary Setting Watch ConditionsOn the debug command line, without any parameters WatchPayroll ¹ To specify a variable or expression to be watched, typePayroll ABC PGM IPL Displaying Active WatchesRemoving Watch Conditions EnddbgDisplay as shown below. Instead Example of Setting a Watch ConditionExample of Setting a Watch Condition BlankDisplay Module SourceStepping Through ObjectStepping Through the Program Object Subroutines You Can Over Into SubproceduresStepping Over Call Statements TIP Stepping Into Call StatementsStep Into Debugex F22This example, you use F22 Step Into to step Into the OPM From ProgramStep completed at line This example, you use F22 Step Into to Subpr Which ModuleInputParm Else SwitchDisplaying Data and Expressions Const On page 201 shows UseDate, Time, Timestamp Fields Unexpected Results when Evaluating VariablesScalar Fields RPG Definition Based 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 Null-Capable Fields DataDisplaying Variable-Length Fields By PointersString = 1ABCD6 STRING=%SUBSTRBIGDATE 1 4 =Fields = Abcdef Changing the Value of FieldsEquating a Name with Or CommandEquating a Name with a Field, Expression, or Command Displaying Attributes of a FieldExamples ForSample Source for Debug Examples First Module Program using Source 215, typeSample Source for Debug Examples To create the program DEBUGEX, typeDS2 DIM3 CtdataDS1 InzabcdeCall Rpgpgm Occur DS2 MovePlist Parm Dsply Seton Dump SetonElse Eval Entry Plist ParmSource for C Procedure cproc. cproc is called by Dbgex 217 Handling ExceptionsException Handling Overview Exception Handling OverviewCall st Indicates That Severe error has been detectedProgram Procedure P1 is Contro Boundary Describes Status Work Being done by a programActive on Exception MessageException Handling within Dure will Only Handle Errors That SubprocedureILE RPG Exception Handling Operation For PGM C OPMNested Exceptions Using Exception HandlersUsing Exception Handlers Exception Handler PriorityPRC1 For other Types MessagesEscape Message PGM2PGM2, each Containing a procedur Example of Unhandled Function CheckOperation as well PGM1Built-in-functions Using RPG-Specific HandlersOptimization Considerations For More Information Optimization See Changing LevelILE RPG For AS/400 Reference provides This Section Provides Some Examples How to Use Each These RInfsr error Subroutines, on Exsr Operation Code Infds ExtenderExplicitly c Using an Error SubroutineProgram Error Operation. If EitherUsing a File Error Infsr Subroutine Status INFSRPrdInfsr INFDSPrdInfdsDisk Ftrnbacklg O Fprint Printer PrdInfds PrdStatusInfds Operation With Factor Entry Using a Program Error SubroutinePosition Definition Specification Enter After KeywordMove Getin ParmsProc Body of Code Goes Here Pssr BegsrTry again Err = If this is a divide-by-zero error, add 1 to the divisorIf control reaches ENDSR, the procedure will fail TAG DIVSubrou Exceptions Order Show how to avoid looping WithinPssr Which is designed to geElse ADD After the ElseMove Inlr OFL Specifying a Return PointHandlers Using a Condition HandlerILE Condition Handlers ILE Condition HandlersAction 10I OutCondTok LIKECondTok 132Printer Rpghdlr LIKECondTokCommunication Area Which Contains Pointer Shows Source For ProcedureIs registered Procedure Parameters Include Pointer Condition HandlerCeehdlu ARR1Proc ProcptrNoopt SDS NooptBegsr Callp SubstCeeutx ILE Cancel Handlers244 CeertxReturn Endsr Procedure to SubProc will not failPssr has a Return operation, so the call from the main Subproc PssrdsplySelect When INZ0 StaticCallb Ceertx Parm Parm OmitLikely Occur With RPG usingCondition Handlers Enabled Using Cancel Hdlr Dsply Msg CanHdlrEndif Return Condition Handler that Ignores CPF4906MsgSev = Warning Handle information or warning messages, otherwise percolateILE RPG for AS/400 Programmers Guide Obtaining an ILE RPG Formatted Dump Using the Dump Operation CodeUsing the Dump Operation Code Obtaining a DumpDoes not Occur Formatted Dump¹ If a Dump operation is bypassed By a Goto operation, 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 261 Defining FilesAssociating Files with Input/Output Devices Associating Files with Input/Output DevicesWrite Compilation Time CertainOperation Device Dependent Device dependency Is that Operation Code is Valid OnlyTypes of File Descriptions Naming FilesTypes of File Descriptions Example of Some Typical Relationships between Using Files withProgram-Described FilesOPTION*EXPDDS Defining Externally Described FilesDefining Externally Described Nbrofcharreplaced. Figure Renaming Record-Format NamesIgnoring Record Formats Renaming Field NamesExternal Using Input SpecificationsModify an DescriptionUsed Program This Example Field You Then Fixed Name Specification Will Get ErrorIndicator Record FilesUsing Output Specifications ALL Level CheckingFor Character Fields zero Is writtenSEQ Special Defining Program-Described FilesData Management Operations and ILE RPG I/O Operations RPG I/O OperationsDelete Data Management Operations and ILE RPG I/O Operations273 File ConsiderationsOverriding and Redirecting File Input and Output Overriding and Redirecting File Input and OutputFMT1 Input OutputInput Output Example of RedirectingProgram Can Chang Allocate Object File LockingFile Locking Data Management manualRecord Locking Record LockingControl For More Information See UsingPath Sharing an Open DataCan Specify SpoolingSpooling Program Details System Open Options Allowed for EachProgram Versus Output SpoolingSRTSEQ/ALTSEQ Data Files and Source AccessingDatabase Files Physical Files and Logical FilesUsing Externally Described Disk Files Using Externally Described Disk FilesRecord Format Specifications Access PathUnique Contained Physical file CUSMSTP, which is IdentifiedUnique Addr Reffldname Dstref Distribution Application Field ReferenceBasdat Edtcdey Cust CheckmfEdtcdej Valid Keys for a Record FileDisk CityReferring to ArgumentsPartial Key Used, Record Blocking and UnblockingValid Using Program-Described Disk FilesUsing Program-Described Disk Files Indexed FileLogical file ORDDTLL. For the two fields Keyword specifies position 15 as the starting poMove Order KEY Chain Sequential FileRecord Address File 10AIDISKMethods for Processing Disk Files Methods for Processing Disk FilesLimits Records Relative Record NumbersADD Consecutive ProcessingSubsequent Text Describes Each Method Processing Database Programming manual Sequential-by-Key ProcessingExamples of Sequential-by-Key Processing Database ProgrammingWeekly hours worked Example, the employee master recordIemprec Ircweek YTDRPT1 Related Files EMPL1Fprint FEMPL1 DiskEofend TAG Seton YTDRPT2 Related Files EMPL1Setoff Read EMPL1 Goto Eofend Move Enum Empno Seton EndifRecords Are Processed as Matching records With For Processing Disk FilesADD Ovthrs Totovt Seton Endif Oprint ADD Tothrs Totovt SetoffADD Ehwrk Tothrs SUB Enhrs OvthrsNnhrs Random-by-Key ProcessingExample of Random-by-Key Processing Emstupd DescriptionsFchange Sequential-within-Limits ProcessingChange Disk Files Examples of Sequential-within-Limits Processing3PIDISK KEYLOC1 Fprint ESWLIM1 Related Files EmpmstLimits Flimits DiskFempmst Disk Fprint Relative-Record-Number ProcessingESWLIM2 Related Files Empmst Valid File Operations Valid File OperationsZ/F Recno Starting and Ending Commitment Using Commitment ControlUsing Commitment Control Abridged for See theBackup and Recovery manualCommitment Control Locks Concepts, UsingFiles For SpecifyingJournal Example of Using Commitment ControlReceiver Disk Commit Ftrans This command calls the program ReviseUpdate Mastrec Tranrec ControlDDM Files CycleDDM Files ReferDistributedto the Data Pre-V3R1 DDMDDM Files 315 AccessingTypes of Device Files Chapter AttachedHandling Page Overflow Accessing Printer DevicesAccessing Printer Devices Specifying Printer FilesOverflow On an and notline,anoverflowthe linelineis Account Example of Printing Headings on EveryExample of Printing a Field on Every OANL2Overf Using the Fetch-OverflowRoutine in Program-Described Files Overflow Printing Setting of the Overflow Indicator Example of Specifying Fetch Overflow Fetch OverflowOPM Prtctl data structure Changing Forms ControlFile Forms Values Contained First four subfieldsDat File Name Associated Data Structure is Accessing Tape DevicesAccessing Tape Devices PrintOvrdbf Accessing Display DevicesUsing Sequential Files Using Sequential FilesProgram name Using Special FilesUsing Special Files FileDescription ErrorStatus Spcl Plist Parm FLD1 Movel Hello Write Excptn Outbuf Seton Example of Using a Special FileSpecial Pgmnameuserio FLDUserio Are Added To the end of the RPG-created Parameter listProgram User-written routine Function Using Workstn FilesUsing Externally Described Workstn Files On page 333 shows an example of the DDS for a display-devic ¹ OutputDescrp RefdstrefPrompt OverlayDevice Specifying Function Key Indicators on Display Device FilesSpecifying Command Keys Display Processing an Externally Described Workstn File Using SubfilesSfile FieldSFL TEXTSubfile Record Use of SubfilesYou press Specified Function key During Read Name SearchSubfil Using Program-Described Workstn FilesUsing Program-Described Workstn Files With Using a Program-DescribedFormat Input SpecificationsCalculation Specifications NameCombined File Valid Workstn File OperationsInput File Output FileMultiple-Device Files Exfmt OperationRead Operation Write OperationKeyword. This field Initialized Is updatedDevid Multiple-Device Files 345 Example of an Interactive ApplicationDatabase Physical File Database Physical FileMain Menu Inquiry InquiryDDS for a Display DeviceCusmain RPG Source Main menu will appear as in on Using Crtrpgmod Create Program By enteringFirst option specifies that the first module in the list Logical File MaintenanceFile Maintenance CUSMSTL1 DDS for aDevice DisplayEdtcdez Mode70DATE Edtcdey Cusmnt RPG Source Record Format contains Constant Customer File MaintenanceElse Move OFF Subroutine Addsub PurposeAddsub Begsr Cstkey Chain CMLREC1 Not *IN50 Move Move Display Mode Endsl MODE1 Endsr Move ADD Mode WhenMove Update Mode When Move Delete Mode When223021 Display ModeCustomer File Maintenance Cstinq223143 On page 357 a new customer is added to the Customer Mast223106 30/94 Customer 00007Bathurst Avenue ADD ModeDelete Mode Code ZipSearch by Search by Zip CodeREFCUSMSTL2 Printqsysprt Indara SzipmenuRelated Files CUSMSTL2 File SZIPMENU. IT hasIndicates when to display Subfile When Indicator 55 is Schzip RPG Source ADD Zero Recnum Endsr Write Subctl Move OFFMove OFF Subfile Is written to the screen as shown in on File indicator 71 on thZip Routine Fills Subfile Record Read FromIdentifies Name field Key Fields Search and Inquiry by NameSearch and Inquiry by Name For Database File Used This Program Defines one recoSubfile Device FileSnammenu DDS for a Display FOOT2File by the Setll OPERATION. then IT Displays Records Using SubfilesSchnam RPG Source This Program Prompts the User for the CustomerExample of an Interactive 367Application Inc File Indicator On the Read operationFile Record Count RecnumJudah Gould Yorktown Inquiry by Name233948 30/94 Customer 00012 Name Gould371 AppendixesILE RPG for AS/400 Programmers Guide Differences RPG/400 ILEFor AS/400 AppendixDebugging and Exception RunningRPG III Will Issue Will issue the RNQ1222 inquiry MessageRPG/400 Will Issue Will issue the RNQ1022 inquiry MessageDbcs Data in Character Fields Compiler Such Programs Will Get Compilation errorsDifferences Between OPM RPG/400 Hurry Appendix B. UsingConversion Overview 379File Record Length File ConsiderationsUSE Log FileConversion Aid Tool Requirements Aid Wont DoConverting Your Source Converting Your SourceCvtrpgsrc Command Frommbr FromfileLibl CurlibTombr TofileQrpglesrc NoneSeclvl YES Insrtpl ExpcpyYES CvtrptSource DefaultsConverting a Member Using Cvtrpgsrc FROMFILEOLDRPG/QRPGSRC Frommbrpayroll TOFILE*NONE Converting All Members in a FilePerforming a Trial Conversion Converting Some MembersCVTRPT*NO Obtaining Conversion ReportsConverting Auto Report Source MembersExample of Source Conversion Inserting Specification TemplatesData Example of Source ConversionConverted source is shown in on Example Source ConversionTo convert this source, enter ARR2 DS1 III specifications for ARR2. The Conversion AidAnalyzing Your Conversion Analyzing Your ConversionConversion Aid generates a conversion report if you specify Using the ConversionShows Command summary for a sample Conversion ReportCall PROG1 YourUsing the Log File Lgtime Colhdgcvt Time Qrncvtfm Lgcent Colhdgcvt CentLgdate Colhdgcvt Date YmmddUse of the /COPY Resolving Conversion ProblemsCompilation Errors in Existing RPG III Code Unsupported RPG III FeaturesTEST1 Comp Context-Sensitive ProblemsRecords Using Members in the converted RPG IV source memberChar Command Or manually Correct Code After ConversionUse of Externally StructuresExtrec When convertedMerging an Array with an Externally Described DS Subfield InitializingDsone Extnameextrec Char Run-time DifferencesBehavior With XYZResolving Conversion Problems Reading Syntax Diagrams Appendix C. The Create CommandsUsing CL Commands How to Interpret Syntax DiagramsKEYWORDREQUIRED-VALUE Crtbndrpg CommandCrtbndrpg Command ValuesAppendix C. The Create Commands407 Srcfile Description of the Crtbndrpg CommandPGM Program-nameSrcmbrtxt SrcmbrGenlvl TextNogen OptionNoxref GENElseif NoextList EventfDbgview StmtOptimize ALLOutput PrintVarchar CvtoptDatetime GraphicUser LangidReplace UsrprfExclude IssuedChange USEPRV FixnbrZoned TgtrlsBinding-directory-name AlwnullInputonly BnddirNEW UsrliblActgrp QileNocol Crtrpgmod CommandCrtrpgmod Command PrfdtaAppendix C. The Create Commands421 PF1 Description of the Crtrpgmod commandUsrprf PF4423 Appendix D. Compiler ListingsCompiler Listings Crtb Which was Compiled UsingCompiler Listing Reading aIndentation Mark Module or ProgramSource member Compiler optionsEject SectionEndif Sequence Numbers Root ListingsPart 1 of 3. Sample Source Part of the Listing Part 2 of 3. Sample Source Part of the Listing Do Number 1a/ *NOSRCSTMT Source HeadingLine Number Ruler LineAdditional DiagnosticCopy Member Table Output Buffer PositionsAlternate Sequence Compile-Time DataTotal Number of Characters Altered Character to be AlteredCross-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 Characters Special443 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