IBM AS/400 Characteristics of Watches, Display, Program statemen, You Debug One Job From Another

Page 213

Setting and Removing Watch Conditions

Characteristics of Watches

You should know the following characteristics about watches before w them:

¹ Watches are monitored system-wide, with a maximum number of 256 wa that can be active simultaneously. This number includes watches set system.

Depending

 

on

overall

system

use,

you

may

be

limited

in

the

number

conditions

you can set at a

given

time.

If

you

try

to

set

a

the maximum number of active watches across the

system

is

excee

receive

an error

message

 

and

the watch condition is not set.

 

Note:

If

 

an

expression

or

a

variable crosses a page boundary, t

 

 

are

used internally to monitor the storage locations. Therefor

 

 

maximum number of expressions or variables that can be watche

 

 

simultaneously

system-wide

ranges

from

128

 

to

256.

 

 

 

 

¹ Watch conditions can only

be

set

when

a

program

is

stopped

under

the expression or variable to be

watched

is

in

scope.

If

this

error message is issued when

a

watch

is

requested, indicating t

sponding

call

stack

entry

does

not

exist.

 

 

 

 

 

 

 

 

 

 

¹ Once

the

watch condition is set, the address of a storage

loca

does

not

 

change. Therefore, if a watch is set on a temporary l

result

in

spurious watch-condition notifications.

 

 

 

 

 

 

 

 

An

example

of

 

this

is

the

automatic

storage

of

an

ILE

RPG

subpro

which

can

be

re-used

after

the

subprocedure

ends.

 

 

 

 

A

watch

condition may

be

 

registered

although

the watched

 

variable

in

scope.

You

must

not

assume

that a variable is in scope

just

watch

condition

has

been

reported.

 

 

 

 

 

 

 

 

 

 

 

 

¹Two watch locations in the same job must not overlap in any way. locations in different jobs must not start at the same storage a wise, overlap is allowed. If these restrictions are violated, an issued.

Note:

Changes made

to

a watched

storage

location are

ignored

if

 

made

by a

job

other

than

the

one that set the watch

con

¹ After

the

command

is

successfully

run,

your

application

is stopped

in your session changes the

contents

of

the

watched

storage

loca

Display

Module

Source

display

is shown.

 

 

 

 

 

If the program has debug data, and a source text view is ava shown. The source line of the statement that was about to be ru content change at the storage-location was detected is highlighted indicates which watch condition was satisfied.

If the program cannot be debugged, the text area of the disp

¹ Eligible programs are automatically

added

to

the debug session if

 

the

watch-stop

condition.

 

 

 

 

 

 

¹

When

multiple watch

conditions

are

hit

on

the

same

program statemen

 

the

first

one

will

be

reported.

 

 

 

 

 

¹

You

can set watch conditions also

when

you are using service job

 

ging,

that

is

when

you

debug

one

job

from

another

job.

Chapter 11. Debugging Programs189

Image 213
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 ProgramFile Description Specifications ProgramSecond file Bonus Output SpecificationsChain EvalHeading Lines That Contain Constant String Payroll SubprocedureILE RPG NotEntire Source Program ReturnFqsysprt 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 usefServices AS/400 ToolsILE 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 ILESource Debugging Bindable APIsWhile 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 ProgramILE Program Using Crtbndrpg Related InformationStrategy 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 itILE Application Using Crtrpgmod UsingStrategy 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 That STATE, ZIPZIP 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 the Source Entry Utility Using SEUEntry 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 CheckingCommand Using the Crtbndrpg 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 ChapterCommand Using the CrtrpgmodYou 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 TransrptOther Endsl ReturnEndsl Prototype for TransInc Creating a Module forProd Prototype for ProdNameFtrnsdta Disk Fqsysprt Printer ItrnsrecQTY 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 CommandRemoving Observability SizeReducing 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 menusYou Run Menu by Entering RpginqRPGCHG, 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 OperationsManaging Dynamically-Allocated Storage INZ*NULLDsply AddName 40A AllocElem@ = next@ Namelen = %len%trimrname = *NULLNull DOW Dealloc Heap Storage ProblemsManaging Your Own Heap RPG procedure ThisBindable APIs Call SomepgmDynarray SeeAPI theReferenceCopy Dynarri CeegtstCeecrhp 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 Procedures Calling ProgramsStatic Call Stack Call stackStack Recursive Calls Recursive calls are only allowed ForThat 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 DocalcUsing Operational Descriptors ILE CEE APICeetsta 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 ReturnBegsr Movel CheckEndif 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, typeOrder of Evaluation Interlanguage CallsEffect Calling Considerations InterlanguageTo obtain Actual Returned value DCL &RET2 TYPE*CHAR LEN2 DCL &RET1 TYPE*CHAR LEN1Fixed-Form Call OperationsUsing the Fixed-Form Call Operations For Callb onlyOperation Operation extender is Used With Examples of Call and Callb Passing Parameters Using ParmOperations OperationUsing the Plist Operation Fixed-Form Call OperationsPlist Procedure Returning from a Main ProcedureNormal End Returning from a CalledReturning from a Called Program or Procedure Abnormal EndEntry 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 GuideHow to AcrossShare 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 Starting the ILE Source DebuggerOPMSRC*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 ILEViewing a Different DbgexLibl 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 BreakpointsSetting an JobBreakpoint 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 Varia Set a breakpoint for Module With This Example Statement View Is used to Set Breakpoint For Set 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 Salary¹ To specify a variable or expression to be watched, type Payroll ABC PGMPayroll Removing Watch Conditions Displaying Active WatchesEnddbg 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 This example, you use F22 Step Into to step Into the OPM F22From Program DebugexThis example, you use F22 Step Into to Subpr Which Module InputParmStep completed at line Switch Displaying Data and ExpressionsElse 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 withFor Sample Source for Debug ExamplesExamples Sample Source for Debug Examples Program using Source 215, typeTo create the program DEBUGEX, type First ModuleDS1 DIM3 CtdataInzabcde DS2Occur DS2 Move Plist ParmCall 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 MessageDure will Only Handle Errors That Subprocedure ILE RPG Exception HandlingException 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 SubrouAfter the Else Move InlrElse 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 DumpFormatted Dump ¹ If a Dump operation is bypassed By a Goto operation,Does 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 WriteNaming Files Types of File DescriptionsTypes of File Descriptions Program-Described Using Files withFiles Example of Some Typical Relationships betweenDefining Externally Described Files Defining Externally DescribedOPTION*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 FilesContained Physical file CUSMSTP, which is Identified UniqueUnique Basdat Edtcdey Dstref Distribution Application Field ReferenceCust Checkmf Addr ReffldnameDisk Valid Keys for a Record FileCity EdtcdejArguments Partial KeyReferring 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 FilesConsecutive Processing Subsequent Text Describes Each Method 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 NnhrsSequential-within-Limits Processing ChangeFchange Disk Files Examples of Sequential-within-Limits ProcessingLimits ESWLIM1 Related Files EmpmstFlimits 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 Files For UsingSpecifying Concepts,Example of Using Commitment Control ReceiverJournal Update Mastrec Tranrec This command calls the program ReviseControl Disk Commit FtransCycle DDM FilesDDM 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 AccountUsing the Fetch-Overflow Routine in Program-Described FilesOverf Overflow Printing Setting of the Overflow Indicator Example of Specifying Fetch Overflow 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 isUsing Sequential Files Accessing Display DevicesUsing Sequential Files OvrdbfUsing Special Files Using Special FilesFile Program nameError StatusDescription Special Pgmnameuserio Example of Using a Special FileFLD 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 On page 333 shows an example of the DDS for a display-devic ¹ OutputPrompt RefdstrefOverlay DescrpSpecifying Function Key Indicators on Display Device Files Specifying Command Keys DisplayDevice 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 FilesIs updated DevidKeyword. 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 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 LogicalDevice DisplayMode 70DATE EdtcdeyEdtcdez Cusmnt RPG Source Record Format contains Constant Customer File MaintenanceSubroutine Addsub Purpose Addsub Begsr Cstkey Chain CMLREC1 Not *IN50 MoveElse 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 223143ADD Mode Delete 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 Write Subctl Move OFF 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 ConsiderationsLog File Conversion Aid Tool RequirementsUSE Converting Your Source Wont DoConverting Your Source AidCvtrpgsrc Command Libl FromfileCurlib FrommbrQrpglesrc TofileNone TombrYES ExpcpyCvtrpt Seclvl YES InsrtplDefaults Converting a Member UsingSource 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 ConversionExample Source Conversion To convert this source, enterConverted 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 PF1Appendix D. Compiler Listings Compiler Listings423 Compiler Listing Which was Compiled UsingReading a CrtbSource member Module or ProgramCompiler options Indentation MarkSection EndifEject 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 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