IBM AS/400 manual Output Spooling, Program Versus

Page 303

SRTSEQ/ALTSEQ

Output Spooling

Output

spooling

is

valid for batch or interactive jobs. The

descript

is specified

in

the RPG

program

by the file name contains

the spec

spooling

as shown

in the

following

diagram:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Spooled

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

File

 

 

 

 

 

 

 

 

 

 

 

 

 

RPG program

QPRINT

File name = QPRINT

SPOOL (*YES)

QUEUE (QPRINT)

Device = PRINTER

 

Execution Time

Start

Printer writer

Start Printer writer Time

Device

Spooling

Queue

QPRINT

Figure

138. Output Spooling Example

 

 

 

 

 

File

override commands can be used at run time to override the spo

specified

in the file description, such as the

number of

copies t

tion,

AS/400

spooling support

allows

you to

redirect

a

file

after the

run.

You

can direct the

same

printed

output to

a

different device

SRTSEQ/ALTSEQ in an

RPG

 

Program

versus

a

DDS

File

 

 

 

 

 

 

 

 

 

 

 

 

 

When

a

keyed

file

is

created

using

SRTSEQ

and

LANGID,

 

the

 

SRTSEQ spec

is

used when

comparing

character

keys

in the file during CHAIN,

SETLL,

READE

and READPE operations. You do not

have

to

 

specify

the

same,

or

SRTSEQ

value

when

creating

the

RPG

program

or module.

 

 

 

 

 

 

When a value for SRTSEQ is specified

on CRTBNDRPG or CRTRPGMOD, then all

character comparison operations in the

program

will

use

 

this

SRTSEQ.

Thi

affects the comparisonall fields,of

including

key

fields,

fields

from

other

fields

declared

in

the

program.

 

 

 

 

 

 

 

 

 

 

 

 

 

You

should

decide

whether

to use SRTSEQ

for

your

RPG

program

based

you

want operations such as IFxx, COMP,

and

SORTA,

to

work

on

your

ch

data,

not

on

what

was specified

when

creating

your

files.

 

 

 

Chapter 15. General File Considerations279

Image 303
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 RPGFile Description Specifications ProgramSecond file Eval Output SpecificationsBonus ChainNot SubprocedureHeading Lines That Contain Constant String Payroll ILE RPGEntire Source Program ReturnFqsysprt Printer 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 usefServices AS/400 ToolsILE R 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 CallSource Debugging Bindable APIsWhile the progra 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 ProgramILE Program Using Crtbndrpg Related InformationStrategy 2 ILE Program 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 XYZILE 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 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 That STATE, ZIPZIP 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 SourceUsing the Source Entry Utility Using SEUEntry Utility 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 handlesCommand Using the Crtbndrpg CommandWith 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 ObjectCommand Using the CrtrpgmodYou Create a Module using the Create 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 FilesOther Endsl ReturnEndsl Prototype for ProdName Creating a Module forPrototype for TransInc ProdFtrnsdta Disk Fqsysprt Printer ItrnsrecQTY Modules Related CL CommandsRPG, mainthe procedureis Additional ExamplesBinding Modules into a Program Binding Modules into a ProgramBinder 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 CommandRemoving Observability SizeReducing an Objects 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 ProgramSample Service Program Sample Service ProgramAPI 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 aYou Run Menu by Entering RpginqRPGCHG, or Rpgadd respectively 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 OperationsManaging Dynamically-Allocated Storage INZ*NULLDsply AddName 40A AllocElem@ = next@ Namelen = %len%trimrname = *NULLNull DOW Dealloc Heap Storage ProblemsCall Somepgm RPG procedure ThisManaging Your Own Heap Bindable APIsDynarray SeeAPI theReferenceCopy Dynarri CeegtstCeecrhp 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 OverviewCalling 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 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 ExportUsing Operational Descriptors ILE CEE APICeetsta Extprocceetsta Omit When Calling Procedure You may sometimes want Leave Out ParOmitting Parameters OPTIONS*OMITAPI Qcmdexc Passing *OMITLeaving Out Parameters OPTIONS*OMIT*NOPASSPsds Passing Prototyped Parameters Checking for the NumberTrimrprovince Return Copy FmtaddrpOPTIONS*NOPASS Const Eval Address = %TRIMRCSTREET# + +Begsr Movel CheckEndif Endsr 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 ParametersOrder of Evaluation Interlanguage CallsEffect DCL &RET2 TYPE*CHAR LEN2 DCL &RET1 TYPE*CHAR LEN1 InterlanguageCalling Considerations To obtain Actual Returned valueFixed-Form Call OperationsUsing the Fixed-Form Call Operations For Callb onlyOperation Operation extender is Used With Operation Passing Parameters Using ParmExamples of Call and Callb OperationsUsing the Plist Operation Fixed-Form Call OperationsPlist Returning from a Called Returning from a Main ProcedureProcedure Normal EndReturning from a Called Program or Procedure Abnormal EndEntry Parm operation is perfor 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 ConsiderationsHow to AcrossShare Data 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 ViewStarting the ILE Source Starting the ILE Source DebuggerOPMSRC*NO 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 CobolViewing a Different DbgexLibl PGM 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 breakpointSetting an JobBreakpoint 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 Watch¹ To specify a variable or expression to be watched, type Payroll ABC PGMPayroll IPL Displaying Active WatchesRemoving Watch Conditions EnddbgDisplay as shown below. Instead Example of Setting a Watch ConditionExample of Setting a Watch Condition BlankDisplay Module SourceObject Stepping Through the Program ObjectStepping Through Over Into Subprocedures Stepping Over Call StatementsSubroutines You Can Stepping Into Call Statements Step IntoTIP Debugex F22This example, you use F22 Step Into to step Into the OPM From ProgramThis example, you use F22 Step Into to Subpr Which Module InputParmStep completed at line Switch Displaying Data and ExpressionsElse 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 FieldFor Sample Source for Debug ExamplesExamples First Module Program using Source 215, typeSample Source for Debug Examples To create the program DEBUGEX, typeDS2 DIM3 CtdataDS1 InzabcdeOccur DS2 Move Plist ParmCall Rpgpgm 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 MessageDure will Only Handle Errors That Subprocedure ILE RPG Exception HandlingException Handling within 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 geAfter the Else Move InlrElse ADD 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 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 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 OnlyNaming Files Types of File DescriptionsTypes of File Descriptions Example of Some Typical Relationships between Using Files withProgram-Described FilesDefining Externally Described Files Defining Externally DescribedOPTION*EXPDDS 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 manual Record 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 PathContained Physical file CUSMSTP, which is Identified UniqueUnique Addr Reffldname Dstref Distribution Application Field ReferenceBasdat Edtcdey Cust CheckmfEdtcdej Valid Keys for a Record FileDisk CityArguments Partial KeyReferring to 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 NumbersConsecutive Processing Subsequent Text Describes Each Method ProcessingADD 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 DescriptionsSequential-within-Limits Processing ChangeFchange Disk Files Examples of Sequential-within-Limits Processing3PIDISK KEYLOC1 Fprint ESWLIM1 Related Files EmpmstLimits Flimits DiskRelative-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 Concepts, UsingFiles For SpecifyingExample of Using Commitment Control ReceiverJournal Disk Commit Ftrans This command calls the program ReviseUpdate Mastrec Tranrec ControlCycle DDM FilesDDM 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 OANL2Using 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 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 FileError StatusDescription Spcl Plist Parm FLD1 Movel Hello Write Excptn Outbuf Seton Example of Using a Special FileSpecial Pgmnameuserio FLDAre 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 ¹ OutputDescrp RefdstrefPrompt OverlaySpecifying Function Key Indicators on Display Device Files Specifying Command Keys DisplayDevice Processing an Externally Described Workstn File Using SubfilesSfile FieldSFL TEXTSubfile Record Use of SubfilesYou press Specified Function key During Read Name SearchUsing Program-Described Workstn Files Using Program-Described Workstn FilesSubfil With Using a Program-DescribedFormat Input SpecificationsCalculation Specifications NameCombined File Valid Workstn File OperationsInput File Output FileMultiple-Device Files Exfmt OperationRead Operation Write OperationIs updated DevidKeyword. This field Initialized Multiple-Device Files 345 Example of an Interactive ApplicationDatabase Physical File Database Physical FileMain Menu Inquiry InquiryDDS for a Display DeviceCusmain RPG Source Using Crtrpgmod Create Program By entering First option specifies that the first module in the listMain menu will appear as in on Logical File MaintenanceFile Maintenance CUSMSTL1 DDS for aDevice 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 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 00007ADD Mode Delete ModeBathurst Avenue 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 Write Subctl Move OFF Move OFFADD Zero Recnum Endsr 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 ConsiderationsLog File Conversion Aid Tool RequirementsUSE Aid Wont DoConverting Your Source Converting Your SourceCvtrpgsrc Command Frommbr FromfileLibl CurlibTombr TofileQrpglesrc NoneSeclvl YES Insrtpl ExpcpyYES CvtrptDefaults Converting a Member UsingSource 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 ConversionExample Source Conversion To convert this source, enterConverted source is shown in on 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 PF4Appendix D. Compiler Listings Compiler Listings423 Crtb Which was Compiled UsingCompiler Listing Reading aIndentation Mark Module or ProgramSource member Compiler optionsSection EndifEject 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 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