IBM AS/400 manual ¹ Output, On page 333 shows an example of the DDS for a display-devic

Page 356

Using Externally Described WORKSTN Files

In

addition to the

field

descriptions (such as field names and attri

for

a display-device

file

are used to:

¹Format the placement of the record on the screen by specifying th

number and position-number entries for each field and constant.

¹Specify attention functions such as underlining and highlighting fields,

image, or a blinking cursor.

¹Specify validity checking for data entered at the display work sta checking functions include detecting fields where data is required, mandatory fill fields, detecting incorrect data types, detecting da range, checking data for a valid entry, and processing modules 10 o digit verification.

¹Control screen management functions, such as determining if fields are

erased, overlaid, or kept when new data is displayed.

¹Associate indicators 01 through 99 with command attention keys or comma

function keys. If a function

key

is

described

as

a command

functi

both

the

response indicator and

the

data

record (with any

modific

on the screen) are returned

to the program. If a

function

key

is

command

attention key (CA), the

response indicator

is

returned

to

the

but the data record remains

unmodified.

Therefore,

input-only

charac

are blank and input-only numeric

field

are

filled

with

zeros,

unless

have been

initialized otherwise.

 

 

 

 

 

 

 

¹Assign an edit code (EDTCDE) or edit word (EDTWRD) keyword to a fie

specify how the field’s values are to be displayed.

¹Specify subfiles.

A display-device-record format contains three types of fields:

¹Input fields. Input fields are passed from the device to the program

program

reads

a

record.

Input fields can be initialized with

a d

the

default

value

is

not

changed,

the default

value

is

passed

to

Input

 

fields

 

that

are not initialized are displayed as blanks

into

station

user

can

enter

data.

 

 

 

 

 

 

 

¹ Output

fields. Output

 

fields

are passed

from

the

program

to

the

devi

the

program

writes

a record to a display. Output fields can

be

program

or by

the

record

format

in

the

device

file.

 

 

¹Output/input (both). fieldsAn output/input field is an output field that ca changed. It becomes an input field if it is changed. Output/input

passed

from

the program when the program writes a

record

to

a di

passed

to

the program when the program reads a record from the d

Output/input

fields

are used when the user is to

change

or

update

is written

to the

display from the program.

 

 

 

If you specify the keyword INDARA in the DDS for a WORKSTN file, th program passes indicators to the WORKSTN file in a separate indicator not in the input/output buffer.

For

a detailed description of an externally-described display-device f

of

valid DDS keywords, DDSsee Reftherence.

Figure 165 on page 333 shows an example of the DDS for a display-devic

332 ILE RPG for AS/400 Programmer's Guide

Image 356
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 ProgramSecond file File Description SpecificationsProgram Output Specifications BonusChain EvalSubprocedure Heading Lines That Contain Constant String PayrollILE RPG NotFqsysprt Printer Entire Source ProgramReturn 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 ManagerILE R ServicesAS/400 Tools 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 ILEWhile the progra Source DebuggingBindable APIs 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 ILEStrategy 2 ILE Program ILE Program Using CrtbndrpgRelated Information 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 itStrategy 3 ILE Application ILE Application Using CrtrpgmodUsing 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 ZIP ThatSTATE, ZIP 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 LibraryEntry Utility Using the Source Entry UtilityUsing SEU 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 CheckingWith CommandUsing the Crtbndrpg Command 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 ChapterYou Create a Module using the Create CommandUsing the Crtrpgmod 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 TransrptEndsl OtherEndsl Return Creating a Module for Prototype for TransIncProd Prototype for ProdNameQTY Ftrnsdta Disk Fqsysprt PrinterItrnsrec Related CL Commands RPG, mainthe procedureisAdditional Examples ModulesBinder Binding Modules into a ProgramBinding Modules into a Program 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 LevelReducing an Objects Removing ObservabilitySize 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 CrtsrvpgmAPI Sample Service ProgramSample Service Program 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 menusRPGCHG, or Rpgadd respectively You Run Menu by EnteringRpginq 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 AbridgedDsply Managing Dynamically-Allocated StorageINZ*NULL Elem@ = next@ AddName 40AAlloc = *NULL Namelen = %len%trimrnameNull DOW Heap Storage Problems DeallocRPG procedure This Managing Your Own HeapBindable APIs Call SomepgmSeeAPI theReference DynarrayCeecrhp Copy DynarriCeegtst 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 127Static Calling ProceduresCalling Programs Stack Call StackCall stack That Most r Stack Entry is Bottom Recursive CallsRecursive calls are only allowed For 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 DocalcCeetsta Extprocceetsta Using Operational DescriptorsILE CEE API 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 ReturnEndif Endsr Begsr MovelCheck 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, typeEffect Order of EvaluationInterlanguage Calls Interlanguage Calling ConsiderationsTo obtain Actual Returned value DCL &RET2 TYPE*CHAR LEN2 DCL &RET1 TYPE*CHAR LEN1Call Operations Fixed-FormOperation Operation extender is Used With Using the Fixed-Form Call OperationsFor Callb only Passing Parameters Using Parm Examples of Call and CallbOperations OperationPlist Using the Plist OperationFixed-Form Call Operations Returning from a Main Procedure ProcedureNormal End Returning from a CalledEntry Parm operation is perfor Returning from a Called Program or ProcedureAbnormal End 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 GuideShare Data How toAcross 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 DebuggingOPMSRC*NO Starting the ILE SourceStarting the ILE Source Debugger 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 ILELibl PGM Viewing a DifferentDbgex 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 BreakpointsBreakpoint Setting anJob 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 SalaryPayroll ¹ To specify a variable or expression to be watched, typePayroll ABC PGM Displaying Active Watches Removing Watch ConditionsEnddbg IPLExample of Setting a Watch Condition Example of Setting a Watch ConditionBlankDisplay Module Source Display as shown below. InsteadStepping Through ObjectStepping Through the Program Object Subroutines You Can Over Into SubproceduresStepping Over Call Statements TIP Stepping Into Call StatementsStep Into F22 This example, you use F22 Step Into to step Into the OPMFrom Program DebugexStep completed at line This example, you use F22 Step Into to Subpr Which ModuleInputParm Else SwitchDisplaying Data and Expressions 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 withExamples ForSample Source for Debug Examples Program using Source 215, type Sample Source for Debug ExamplesTo create the program DEBUGEX, type First ModuleDIM3 Ctdata DS1Inzabcde DS2Call Rpgpgm Occur DS2 MovePlist Parm 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 onException Handling within Dure will Only Handle Errors That SubprocedureILE RPG Exception Handling 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 SubrouElse ADD After the ElseMove Inlr 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 DumpDoes not Occur Formatted Dump¹ If a Dump operation is bypassed By a Goto operation, 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 DevicesAssociating Files with Input/Output Devices 261Compilation Time Certain Operation Device Dependent Device dependency Is thatOperation Code is Valid Only WriteTypes of File Descriptions Naming FilesTypes of File Descriptions Using Files with Program-DescribedFiles Example of Some Typical Relationships betweenOPTION*EXPDDS Defining Externally Described FilesDefining Externally Described 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 FilesUnique Contained Physical file CUSMSTP, which is IdentifiedUnique Dstref Distribution Application Field Reference Basdat EdtcdeyCust Checkmf Addr ReffldnameValid Keys for a Record File DiskCity EdtcdejReferring to ArgumentsPartial Key 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 FilesADD Consecutive ProcessingSubsequent Text Describes Each Method Processing 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 NnhrsFchange Sequential-within-Limits ProcessingChange Examples of Sequential-within-Limits Processing Disk FilesESWLIM1 Related Files Empmst LimitsFlimits Disk 3PIDISK KEYLOC1 FprintFempmst 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 Using Files ForSpecifying Concepts,Journal Example of Using Commitment ControlReceiver This command calls the program Revise Update Mastrec TranrecControl Disk Commit FtransDDM Files CycleDDM 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 AccountOverf Using the Fetch-OverflowRoutine in Program-Described Files Overflow Printing Setting of the Overflow Indicator Fetch Overflow Example of Specifying Fetch OverflowOPM Prtctl data structure Changing Forms ControlFile Forms Values Contained First four subfieldsDat 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 nameDescription ErrorStatus Example of Using a Special File Special Pgmnameuserio FLD Spcl Plist Parm FLD1 Movel Hello Write Excptn Outbuf SetonUserio Are Added To the end of the RPG-created Parameter listProgram User-written routine Function Using Workstn FilesUsing Externally Described Workstn Files ¹ Output On page 333 shows an example of the DDS for a display-devicRefdstref PromptOverlay DescrpDevice Specifying Function Key Indicators on Display Device FilesSpecifying Command Keys Display Using Subfiles Processing an Externally Described Workstn FileField SfileUse of Subfiles You press Specified Function key During ReadName Search SFL TEXTSubfile RecordSubfil Using Program-Described Workstn FilesUsing Program-Described Workstn Files Using a Program-Described WithInput Specifications Calculation SpecificationsName FormatValid Workstn File Operations Input FileOutput File Combined FileExfmt Operation Read OperationWrite Operation Multiple-Device FilesKeyword. This field Initialized Is updatedDevid Multiple-Device Files Example of an Interactive Application Database Physical FileDatabase Physical File 345Inquiry DDS for aDisplay Device Main Menu InquiryCusmain RPG Source Main menu will appear as in on Using Crtrpgmod Create Program By enteringFirst option specifies that the first module in the list File Maintenance File MaintenanceCUSMSTL1 DDS for a LogicalDisplay DeviceEdtcdez Mode70DATE Edtcdey Record Format contains Constant Customer File Maintenance Cusmnt RPG SourceElse Move OFF Subroutine Addsub PurposeAddsub Begsr Cstkey Chain CMLREC1 Not *IN50 Move 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 223143Bathurst Avenue ADD ModeDelete Mode 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 ADD Zero Recnum Endsr Write Subctl Move OFFMove OFF 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 LengthUSE Log FileConversion Aid Tool Requirements Wont Do Converting Your SourceConverting Your Source AidCvtrpgsrc Command Fromfile LiblCurlib FrommbrTofile QrpglesrcNone TombrExpcpy YESCvtrpt Seclvl YES InsrtplSource DefaultsConverting a Member Using 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 ConversionConverted source is shown in on Example Source ConversionTo convert this source, enter 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 PF1423 Appendix D. Compiler ListingsCompiler Listings Which was Compiled Using Compiler ListingReading a CrtbModule or Program Source memberCompiler options Indentation MarkEject SectionEndif 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 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