131
TABLE OF CONTENTS RPG02: INTERACTIVE PROGRAM : DETAIL DESCRIPTION. ..................................................................... 1 2.1 THE EXAMPLE PROGRAM : DESCRIPTION. ....................................................................................................... 2 2.2 THE EXAMPLE PROGRAM : TECHNICAL ANALYSIS. ........................................................................................ 6 2.3 THE EXAMPLE PROGRAM : DISPLAY FILE. ...................................................................................................... 7 2.4 PROGRAM HEADER......................................................................................................................................... 9 2.5 THE H-SPECIFICATION. ................................................................................................................................. 11 2.6 THE DISPLAY FILE........................................................................................................................................ 12 2.7 FILES USED IN THE PROGRAM. ...................................................................................................................... 14 2.8 INITIAL INDICATOR TABLE. .......................................................................................................................... 17 2.9 ADDITIONAL E- AND I-SPECIFICATIONS. ....................................................................................................... 18 2.10 THE PROGRAM STATUS DATA STRUCTURE. ................................................................................................. 19 2.11 DISPLAY FILE : FILE INFORMATION DATA STRUCTURE ................................................................................ 20 2.12 DATA BASE FILES : FILE INFORMATION DATA STRUCTURE .......................................................................... 21 2.13 IDPARM : IDDOS PARAMETER DATA STRUCTURE. ................................................................................... 22 2.14 CURSOR POSITION CONVERSION DATA STRUCTURE. .................................................................................... 24 2.15 DATE CONVERSION DATA STRUCTURES. ..................................................................................................... 25 2.16 KEYLIST SECTION......................................................................................................................................... 26 2.17 (ENTRY) PARAMETER LIST. .......................................................................................................................... 27 2.18 DEFAULT PARAMETER LISTS IN THE PROGRAM............................................................................................. 28 2.19 MAIN ROUTINE : RETRIEVE THE DATA AREA IDPARM ................................................................................ 33 2.20 MAIN ROUTINE : EXECUTING THE INITIALIZATION ROUTINE ........................................................................ 34 2.21 MAIN ROUTINE : CASE ROUTINE DRIVER. .................................................................................................... 35 2.22 MAIN ROUTINE : SUPER-LEVEL PROGRAM DRIVERS. ..................................................................................... 36 2.23 MAIN ROUTINE : THE ##END TAG. ............................................................................................................. 37 2.24 MAIN ROUTINE : WRITE DATA AREA IDPARM ........................................................................................... 38 2.25 MAIN ROUTINE : ENDING THE PROGRAM. ..................................................................................................... 39 2.26 FIXED FORMAT : THE FORMAT DRIVER. ........................................................................................................ 40 2.27 FIXED FORMAT : POINTER 01. ...................................................................................................................... 42 2.28 FIXED FORMAT : POINTER 10-20-30. ............................................................................................................ 43 2.29 FIXED FORMAT : POINTER 10-20-30. ............................................................................................................ 44 2.30 FIXED FORMAT : POINTER 40. ...................................................................................................................... 45 2.31 FIXED FORMAT : POINTER 50. ...................................................................................................................... 47 2.32 FIXED FORMAT : POINTER 50. ...................................................................................................................... 49 2.33 FIXED FORMAT : POINTER 60-61-62. ............................................................................................................ 50 2.34 FIXED FORMAT : POINTER 90. ...................................................................................................................... 51 2.35 SUBFILE FORMAT: THE FORMAT DRIVER...................................................................................................... 52 2.36 SUBFILE FORMAT : POINTER 01. ................................................................................................................... 54 2.37 SUBFILE FORMAT : POINTER 10. ................................................................................................................... 55 2.38 SUBFILE FORMAT : POINTER 20. ................................................................................................................... 56 2.39 SUBFILE FORMAT : POINTER 30. ................................................................................................................... 58 2.40 SUBFILE FORMAT : POINTER 10-20-30. ........................................................................................................ 59 2.41 SUBFILE FORMAT : POINTER 40. ................................................................................................................... 60 2.42 SUBFILE FORMAT : POINTER 50. ................................................................................................................... 61 2.43 SUBFILE FORMAT : POINTER 50. ................................................................................................................... 63 2.44 SUBFILE FORMAT : POINTER 60. ................................................................................................................... 65 2.45 SUBFILE FORMAT : POINTER 61. ................................................................................................................... 66 2.46 SUBFILE FORMAT : POINTER 62. ................................................................................................................... 67 2.47 SUBFILE FORMAT : POINTER 90. ................................................................................................................... 68 2.48 USER CODE : PRE-DISPLAY........................................................................................................................... 69 2.49 USER CODE : INITIALIZE SUBFILE RECORD. .................................................................................................. 70 2.50 USER CODE : SUBFILE RECORD CONTROL. .................................................................................................... 71 2.51 USER CODE : ADDITIONAL PROCESSING ON SUBFILE RECORD. .................................................................... 72 2.52 USER CODE : DISPLAY NAVIGATION CONTROL. ............................................................................................ 73 2.53 USER CODE : COMMAND-KEYS..................................................................................................................... 74 2.54 USER CODE : SUBFILE GENERAL HANDLING. ................................................................................................ 75 2.55 USER CODE : SUBFILE DETAIL HANDLING. ................................................................................................... 76

RPG02 - Interactive Program - Detail Description

Embed Size (px)

DESCRIPTION

rpg02

Citation preview

  • TABLE OF CONTENTS

    RPG02: INTERACTIVE PROGRAM : DETAIL DESCRIPTION. ..................................................................... 1

    2.1 THE EXAMPLE PROGRAM : DESCRIPTION. ....................................................................................................... 2 2.2 THE EXAMPLE PROGRAM : TECHNICAL ANALYSIS. ........................................................................................ 6 2.3 THE EXAMPLE PROGRAM : DISPLAY FILE. ...................................................................................................... 7 2.4 PROGRAM HEADER ......................................................................................................................................... 9 2.5 THE H-SPECIFICATION. ................................................................................................................................. 11

    2.6 THE DISPLAY FILE. ....................................................................................................................................... 12 2.7 FILES USED IN THE PROGRAM. ...................................................................................................................... 14 2.8 INITIAL INDICATOR TABLE. .......................................................................................................................... 17 2.9 ADDITIONAL E- AND I-SPECIFICATIONS. ....................................................................................................... 18

    2.10 THE PROGRAM STATUS DATA STRUCTURE. ................................................................................................. 19 2.11 DISPLAY FILE : FILE INFORMATION DATA STRUCTURE ................................................................................ 20 2.12 DATA BASE FILES : FILE INFORMATION DATA STRUCTURE .......................................................................... 21 2.13 IDPARM : IDDOS PARAMETER DATA STRUCTURE. ................................................................................... 22 2.14 CURSOR POSITION CONVERSION DATA STRUCTURE. .................................................................................... 24 2.15 DATE CONVERSION DATA STRUCTURES. ..................................................................................................... 25 2.16 KEYLIST SECTION......................................................................................................................................... 26 2.17 (ENTRY) PARAMETER LIST. .......................................................................................................................... 27

    2.18 DEFAULT PARAMETER LISTS IN THE PROGRAM. ............................................................................................ 28 2.19 MAIN ROUTINE : RETRIEVE THE DATA AREA IDPARM ................................................................................ 33 2.20 MAIN ROUTINE : EXECUTING THE INITIALIZATION ROUTINE ........................................................................ 34 2.21 MAIN ROUTINE : CASE ROUTINE DRIVER. .................................................................................................... 35

    2.22 MAIN ROUTINE : SUPER-LEVEL PROGRAM DRIVERS. ..................................................................................... 36 2.23 MAIN ROUTINE : THE ##END TAG. ............................................................................................................. 37 2.24 MAIN ROUTINE : WRITE DATA AREA IDPARM ........................................................................................... 38 2.25 MAIN ROUTINE : ENDING THE PROGRAM. ..................................................................................................... 39

    2.26 FIXED FORMAT : THE FORMAT DRIVER. ........................................................................................................ 40 2.27 FIXED FORMAT : POINTER 01. ...................................................................................................................... 42 2.28 FIXED FORMAT : POINTER 10-20-30. ............................................................................................................ 43 2.29 FIXED FORMAT : POINTER 10-20-30. ............................................................................................................ 44

    2.30 FIXED FORMAT : POINTER 40. ...................................................................................................................... 45 2.31 FIXED FORMAT : POINTER 50. ...................................................................................................................... 47 2.32 FIXED FORMAT : POINTER 50. ...................................................................................................................... 49 2.33 FIXED FORMAT : POINTER 60-61-62. ............................................................................................................ 50

    2.34 FIXED FORMAT : POINTER 90. ...................................................................................................................... 51 2.35 SUBFILE FORMAT: THE FORMAT DRIVER...................................................................................................... 52 2.36 SUBFILE FORMAT : POINTER 01. ................................................................................................................... 54 2.37 SUBFILE FORMAT : POINTER 10. ................................................................................................................... 55

    2.38 SUBFILE FORMAT : POINTER 20. ................................................................................................................... 56 2.39 SUBFILE FORMAT : POINTER 30. ................................................................................................................... 58 2.40 SUBFILE FORMAT : POINTER 10-20-30. ........................................................................................................ 59 2.41 SUBFILE FORMAT : POINTER 40. ................................................................................................................... 60 2.42 SUBFILE FORMAT : POINTER 50. ................................................................................................................... 61 2.43 SUBFILE FORMAT : POINTER 50. ................................................................................................................... 63 2.44 SUBFILE FORMAT : POINTER 60. ................................................................................................................... 65 2.45 SUBFILE FORMAT : POINTER 61. ................................................................................................................... 66

    2.46 SUBFILE FORMAT : POINTER 62. ................................................................................................................... 67 2.47 SUBFILE FORMAT : POINTER 90. ................................................................................................................... 68 2.48 USER CODE : PRE-DISPLAY. .......................................................................................................................... 69 2.49 USER CODE : INITIALIZE SUBFILE RECORD. .................................................................................................. 70

    2.50 USER CODE : SUBFILE RECORD CONTROL. .................................................................................................... 71 2.51 USER CODE : ADDITIONAL PROCESSING ON SUBFILE RECORD. .................................................................... 72 2.52 USER CODE : DISPLAY NAVIGATION CONTROL. ............................................................................................ 73 2.53 USER CODE : COMMAND-KEYS..................................................................................................................... 74 2.54 USER CODE : SUBFILE GENERAL HANDLING. ................................................................................................ 75 2.55 USER CODE : SUBFILE DETAIL HANDLING. ................................................................................................... 76

  • 2.56 USER CODE : POST-DISPLAY. ........................................................................................................................ 77 2.57 THE PROGRAM INITIALIZATION ROUTINE. .................................................................................................... 78 2.58 THE PROGRAM ERROR HANDLING ROUTINE. ................................................................................................ 81 2.59 USER WRITTEN SUBROUTINES. ..................................................................................................................... 82

    2.60 FILE HANDLING : TRANSFER FILE --> SCREEN .............................................................................................. 83 2.61 FILE HANDLING : TRANSFER SCREEN --> FILE .............................................................................................. 84 2.62 FILE HANDLING : INITIALIZE NON-KEY FIELDS. ............................................................................................ 85 2.63 FILE HANDLING : FILL KEYLIST. ................................................................................................................... 86

    2.64 DATE CONVERSION ROUTINE. ....................................................................................................................... 87 2.65 PROGRAM TABLES. ....................................................................................................................................... 89 2.66 PRE-DISPLAY DATA BASE ACCESSES. ............................................................................................................ 90 2.67 POST-DISPLAY DATA BASE ACCESSES. .......................................................................................................... 92

    2.68 USER ASSIST CODE : CHECKING VALUES AND RANGES. ................................................................................ 94 2.69 USER ASSIST CODE : FILECHECK. ................................................................................................................. 97 2.70 USER ASSIST CODE : CHECKING VALIDITY OF DATES. .................................................................................. 99 2.71 COMMAND KEY PROCESSING. ..................................................................................................................... 102

    2.72 DISPLAYING ERRORS ON THE SCREEN. ........................................................................................................ 106 2.73 HANDLING MORE THAN ONE ERROR ON A SCREEN. ..................................................................................... 107 2.74 HANDLING A GROUP OF RECORDS TO LOAD A SUBFILE. .............................................................................. 108 2.75 THE ##TF99 FIELD. .................................................................................................................................... 109

    2.76 CALLING ANOTHER PROGRAM. ................................................................................................................... 110 2.77 PROGRAM INDICATORS. .............................................................................................................................. 111 2.78 PROGRAM ROUTINES. ................................................................................................................................. 112 2.79 PROGRAM FIELDS. ...................................................................................................................................... 114

  • Manual IDDOS 13 RPG02 1 Interactive Program: Detail Description

    RPG02: Interactive Program : Detail Description.

    This chapter describes the source of an intreactive program, generated by IDDOS. This is done by means of an example program.

  • Manual IDDOS 13 RPG02 2 Interactive Program: Detail Description

    2.1 The example program : Description.

    Program MN001RGI : Customer Maintenance.

    The first screen is a key prompt. The customer code must be entered. This can be an existing code. In that case, the customer details can be updated. Otherwise, a new customer can be entered.

    The second screen is a detail screen to enter a new customer or to change the details of an existing customer.

    The third screen is a selection screen to select a customer by name.

    Files to be used in the program:

    Customer Master by Customer Code: Update/Add

    Customer Master by Name : Input (for selection)

  • Manual IDDOS 13 RPG02 3 Interactive Program: Detail Description

    Screen 1 : Key Prompt.

    .... ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7.

    01 MANUAL IDDOS MN001RGI S01FMT 00/00/00

    02 00:00:00

    03

    04

    05 Customer Code: BBBBB

    06

    07

    08

    09

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23 F04=Selection F03=Exit F12=Cancel

    24 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

    .... ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7.

    Pre-display : Initialize customer code

    F03 : Exit Program

    F04 : Selection (to screen 3, page 1)

    F12 : Exit Program

    Enter : Test : Customer Code Required Proceed to screen 2

  • Manual IDDOS 13 RPG02 4 Interactive Program: Detail Description

    Screen 2 : Detail Maintenance screen.

    .... ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7.

    01 MANUAL IDDOS MN001RGI S02FMT 00/00/00

    02 00:00:00

    03

    04

    05 Customer Code: OOOOO

    06

    07

    08 Customer Name: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

    09

    10 Customer Address: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

    11

    12 Customer Zip Code: BBBBBBBB

    13

    14 Customer City: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

    15

    16

    17 Customer Date: 999999

    18

    19

    20 Customer Activity Code: B OOOOOOOOOOOOOOOOOOOOOOOOOOO

    21

    22

    23 F11=Delete F03=Exit F12=Cancel

    24 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

    .... ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7.

    Pre-display : --> Update : retrieve data from data base --> Add : initialize screen fields

    F03 : Exit Program

    F04 : Prompt (if field has a value table)

    F11 : Delete customer

    F12 : Back to screen 1 (no update)

    Enter : Test : Customer Name Required Test : Valid Zip Code (Filecheck) Test : Valid Date Test : Valid activity code Data base update

    Proceed to screen 1

  • Manual IDDOS 13 RPG02 5 Interactive Program: Detail Description

    Screen 3 : Selection Screen.

    .... ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7.

    01 MANUAL IDDOS MN001RGI S03SFL 00/00/00

    02 00:00:00

    03 Type Options, press Enter

    04 1=Select

    05

    06 Opt Name Code

    07 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    08 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    09 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    10 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    11 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    12 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    13 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    14 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    15 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    16 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    17 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    18 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

    19

    20

    21

    22

    23 F03=Exit F12=Cancel

    24 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

    .... ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7.

    Pre-display : Set start value for subfile (from BOF)

    F03 : Exit Program

    F12 : Back to screen 1

    Enter : For each selected customer : proceed to screen 2 for update

  • Manual IDDOS 13 RPG02 6 Interactive Program: Detail Description

    2.2 The Example program : Technical Analysis.

    The technical analysis for the program will be generated by IDDOS. The detail code, needed to complete the program, is described.

    To complete the technical analysis, a few lines were added by the analyst.

    A technical analysis of a program can be re-generated with IDDOS. User added text will remain unchanged.

    To complete such a program, additional code can be added in user process points. This code can also be described in this technical document.

    The source of the technical analysis for this interactive program is included in the toolbook library IDDOSTLB

  • Manual IDDOS 13 RPG02 7 Interactive Program: Detail Description

    2.3 The Example program : Display File.

    Some elements used to build the display file source, are

    display file header

    REF keyword, referencing to the pseudo reference file.

    !!! This keyword should never be removed. If it is removed, selection from the pseudo reference file in SDA is lost.

    PUTOVER and OVERLAY/PROTECT for each format

    The default panel items, taken from the Reference Application System.

    CRSLOC keyword with ##LINE for line position and ##POS for column position

    RTNCSRLOC keyword with ##CSRC for record name and ##CSFL for the field name and ##CSPS for position in the field

    SFLCSRRRN keyword with ##CSRR for subfile relative record number

    KEEP keyword

    For each format, the command keys to be used

    H-specs if UIM help function is used

    For each output field, OVRDTA with indicator 81 For each both field, OVRDTA with indicator 82

    Instruction formats, including text lines for the command keys and a message field if you aren't using an error subfile.

    All information necessary for an error subfile when using error subfile.

    WINDOW keywords if the format will be presented in window.

    SFLNXTCHG for each subfile format

    SFLDSP/SFLDSPCTL/SFLCLR keyword for each subfile control format

  • Manual IDDOS 13 RPG02 8 Interactive Program: Detail Description

    SFLPAG keyword for each subfile control format

    SFLSIZ (SFLPAG + 1) keyword for each subfile control format

    !!! Sources of display file and program are included in the toolbook library IDDOSTLB.

  • Manual IDDOS 13 RPG02 9 Interactive Program: Detail Description

    2.4 Program Header *****************************************************************

    * *

    * Description : Customer Maintenance *

    * *

    * Author : RVA *

    * *

    * Creation date : 20.05.99 *

    * *

    *****************************************************************

    * GENERATED BY THE PROGRAM GENERATOR *

    * *

    * IIIII DDDD DDDD OOOO SSSSS *

    * I D D D D O O S *

    * I D D D D O O SSSSS *

    * I D D D D O O S *

    * IIIII DDDD DDDD OOOO SSSSS *

    * *

    * (C) COPYRIGHT Real Software N.V. 1999 *

    *****************************************************************

    The following information is contained in the program header:

    Description :

    This is the program description, entered on the program definition screen.

  • Manual IDDOS 13 RPG02 10 Interactive Program: Detail Description

    Fig. 1 ..................................................................................

    : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Hotline 9.1 level 10 ID002RGI :

    : Programs S02 :

    : :

    : Program . . . . . . . . : RV006RGI :

    : Standard . . . . . . . . . *YES *YES, *NO :

    : Subsystem id . . . . . . . RV + :

    : Type . . . . . . . . . . . RPG + Coding in /FREE . N (Y/N) :

    : Description . . . . . . . Customer Maintenance :

    : Kind . . . . . . . . . . . I + :

    : Exit . . . . . . . . . . . *PERM *PERM, *TEMP, *USER :

    : Use IDPARM . . . . . . . . Y (Y/N) :

    : ERRSFL . . . . . . . . . . N (Y/N) :

    : UIM . . . . . . . . . . . N (Y/N/F/U) :

    : Module . . . . . . . . . . N (Y/N) :

    : Program . . . . . . . . . N (Y/N/S) :

    : Activation group . . . . . (Name, *DFT, *NEW, *CALLER) :

    : :

    : :

    : :

    : Language . + :

    : Copy . . . + :

    : F3=Exit F4=Prompt F5=Messages F9=Copy F12=Cancel :

    : F13=Conventions F14=Description F24=More keys :

    : :

    :................................................................................:

    Author :

    The user name of the user, who generated the program source.

    Creation Date :

    Date of generation of the program.

  • Manual IDDOS 13 RPG02 11 Interactive Program: Detail Description

    2.5 The H-specification.

    H 1 /J

    The H-specification is automatically provided by the generator. This H-specification is taken from the data area RPGHSPEC in the repository library. RPGLEHSPEC can be defined at system level.

    IDDOS uses a default H-specification. This data area can be changed, to customize the H-specification for your applications,

  • Manual IDDOS 13 RPG02 12 Interactive Program: Detail Description

    2.6 The Display File.

    FMN001RGDCF E WORKSTN KINFDS ##DSDF

    F KINFSR *PSSR

    F ##RN03KSFILE S03SFL

    For each interactive program, ONE AND ONLY ONE display file must be used.

    This display file can contain any combination of fixed and subfile formats, with up to 99 formats in one program.

    Fig. 2

    ..................................................................................

    : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Hotline 9.1 level 10 ID018RGI :

    : INTERACTIVE program design S03 :

    : Formats used in program . . . . . . : RV006RGI :

    : Customer Maintenance :

    : Display file name . . . . . . . . . : RV006RGD :

    : Display file UC . . . . . . . . . . . N :

    : Display file size . . . . . . . . . . 0 (0=24*80, 1=27*132) :

    : Add format number . . . . . 00 :

    : Format type . . . . . . . . :

    : :

    : Type options, press Enter. :

    : 1=Detail 4=Delete 5=Cmd keys 7=Pre-access 8=Post-access :

    : 9=Synonyms D=Description P=PPU :

    : Opt Format Next format Pointer :

    : S01FMT 01 01 :

    : :

    : :

    : :

    : :

    : :

    : EINDE :

    : F3=Exit F11=Gen. PNLGRP F12=Cancel F13=Conventions :

    : :

    :................................................................................:

    The F-specification for the display file, is always the first F-specification generated in the program.

    User control: the value defined in the system conventions is presented the first time you work in this program. You can change the value.

    Display file size: the value defined in the system conventions is presented the first time you work in this program. You can change the value.

    !!! Attention: changing from 27*132 to 24*80 causes the lost of all data outside the limits of 24*80.

  • Manual IDDOS 13 RPG02 13 Interactive Program: Detail Description

    For a display file, a continuation line is generated for the INFDS and for the INFSR option.

    The data structure name for the INFDS option for the display file, is always ##DSDF, the subroutine name for the INFSR option is always *PSSR.

    For each subfile used in the display file, an additional continuation line is generated with the SFILE option. It contains the name of the format to be processed as a subfile (SnnSFL) and the name of the RRN field (##RNnn).

    For each continuation line, 'nn' is replaced by the format number.

  • Manual IDDOS 13 RPG02 14 Interactive Program: Detail Description

    2.7 Files used in the program.

    FMNCUMAL1UF E K DISK A

    F KINFDS ##DS01

    F KINFSR *PSSR

    The files used in the program are generated in the order they were entered on the 'Files used in program' entry screen.

    Fig. 3

    ....................................................................................

    : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID018RGI :

    : INTERACTIVE program design S01 :

    : :

    : Files used in program . . . . . . . : MN003RGI :

    : :

    : Type options, press Enter. :

    : 1=Detail 2=Recfmt 4=Delete 5=Browse 9=Keywords :

    : 7=DB-access 8=Based on :

    : Opt Nr Filename Internal Text Use :

    : 01 MN02LF MN02LF Logical file MN02LF U K A:

    : 02 MN01PF MN01PF Physical file MN01PF U :

    : :

    : :

    : :

    : :

    : :

    : :

    : :

    : :

    : :

    : :

    : F3=Exit F6=New DB file F8=Formats :

    : F10=Files F12=Cancel :

    : :

    :..................................................................................:

    For each file entered in the function 'Files & Formats', IDDOS generates a F-specification or an external data structure (Use = E).

    The details for this F-specification are taken from the detail screen in the 'Files & Formats' function.

  • Manual IDDOS 13 RPG02 15 Interactive Program: Detail Description

    Fig. 4

    ....................................................................................

    : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID020RGI :

    : INTERACTIVE program design S01 :

    : :

    : Program . . . . . . . . : MN003RGI :

    : :

    : File . . . . . . . . . . . MN01PF + :

    : System . . . . . . . . . . DOCU :

    : Internal name . . . . . . MN01PF :

    : File number . . . . . . . 02 :

    : File type . . . . . . . . I :

    : Keyed file . . . . . . . . :

    : Add file . . . . . . . . . :

    : Use . . . . . . . . . . . B :

    : User controlled . . . . . N :

    : Commitment control . . . . N :

    : :

    : :

    : :

    : :

    : Generation INFSR Y :

    : :

    : :

    : F3=Exit F4=Prompt F12=Cancel :

    : :

    :..................................................................................:

    The details entered on this screen are used to build the F-specifications.

    The file name is the file name entered on the 'Files used in the program' screen. If an internal name has been specified, this name will be placed in the F-specification by IDDOS. An external override must be specified before a call to this program can be issued. This override must also be specified at program compilation time.

    The file type for the F-specification is taken from the 'File-type' field on the detail screen.

    The file designation is always 'F' (full procedural file). The record address type is taken from the 'Keyed File' field on the detail screen. This entry must be 'K' or blank.

    The device type for the F-specification is always 'DISK'.

  • Manual IDDOS 13 RPG02 16 Interactive Program: Detail Description

    If an 'A' was entered in the 'Add File' field on the detail screen, an 'A' is generated in position 66 of the F-specification, to indicate the program is allowed to add records to this data base file.

    If the 'User Controlled' field is 'Y', the value 'UC' is generated in position 71-72 of the F-specification.

    If commitment control is wanted, the continuation line for commitment control will be generated.

    For each file, a continuation line is generated for the INFDS and for the INFSR option. The data structure name for the INFDS option for the display file is always ##DSff, the subroutine name for the INFSR option is always *PSSR.

    For each file, 'ff' is replaced by the file number of the file in the program.

    For each file, additional continuation lines can be generated for the IGNORE option. The records to be ignored in the program can be entered through the 'Files & Formats' function.

    Fig. 5

    ....................................................................................

    : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID118RGI :

    : Records in program S01 :

    : :

    : Selection record format for file . . . : MN02LF :

    : renamed as : :

    : in program : MN003RGI :

    : :

    : Ignore Number Record format Renamed Record format :

    : Y/N :

    : N 01 MN02LFR :

    : :

    : :

    : :

    : :

    : :

    : :

    : :

    : :

    : :

    : F12=Cancel :

    : :

    :..................................................................................:

  • Manual IDDOS 13 RPG02 17 Interactive Program: Detail Description

    2.8 Initial indicator Table.

    E ##I 50 1

    This array is used to refresh the first 50 indicators after displaying a format. Initially, the generator will provide the '0' value for each element of the array.

    The programmer can use indicators 01-50 to display errors on the screen. After displaying the format, the ##I array will be used to overwrite the program indicators 01-50. The programmer can use indicators 51-60 to work with field conditioning,... After displaying the format, these indicators remain unchanged. If necessary, the programmer must change them in the user code.

    !!! If more than 50 indicators are necessary to display all the errors, indicators 51-60 can also be used. In that case, the program must provide for initialization of the used indicators in the range 51-60. If more than 10 indicators are necessary for field conditioning, indicators 01-50 can also be used. In that case, the programmer must assign assign a value '1' to the corresponding element in array ##I to keep the indicator on.

  • Manual IDDOS 13 RPG02 18 Interactive Program: Detail Description

    2.9 Additional E- and I-specs/D-specs.

    *********************************************************

    *IDDOS: User Code : Additional E- and I-specifications

    *

    *********************************************************

    Additional arrays or data structures can be entered in the INP process point. The specifications in this process point will be placed in the program source.

  • Manual IDDOS 13 RPG02 19 Interactive Program: Detail Description

    2.10 The Program Status Data Structure.

    I*----------------------------------------------------------

    I*IDDOS: Program Status Data Structure

    I*----------------------------------------------------------

    I##PGDS SDS 429

    I 1 10 ##PGNM

    I 81 90 ##PGLB

    I 91 170 ##DATA

    I 201 208 ##PGFL

    I 209 2130##STCD

    I 244 253 ##JBNM

    I 254 263 ##PGUS

    I 264 2690##JBNR

    I 358 367 ##CUUS

    I *PARMS ##PGPM

    I *STATUS ##PGST

    The program status data structure makes the program exception/error information available to the program.

    The following details are available :

    - ##PGNM : the program name

    - ##PGLB : the name of the library in which the program is located.

    - ##DATA : the message data.

    - ##PGFL : the name of the file on which the last file operation occurred.

    - ##STCD : the status code.

    - ##PGUS : the user name from the user profile

    - ##JBNR : the jobnumber in which the program is

    running

    - ##CUUS : the current user

    - ##PGPM : the number of parameters passed to the program

    - ##PGST : the program status code

    If other details are needed, the following procedure can befollowed :

    - define a data structure (429 positions) with the fields containing the information needed by the program

    - move the contents of ##PGDS to the defined data structure

    - use the defined fields to capture the information.

  • Manual IDDOS 13 RPG02 20 Interactive Program: Detail Description

    2.11 Display file : File Information Data Structure

    I*----------------------------------------------------------

    I*IDDOS: File Information Data Structure

    I*----------------------------------------------------------

    I##DSDF DS 400

    I 1 8 ##FLNM

    I 38 45 ##FRMT

    I 370 370 ##LNNR

    I 371 371 ##PSNR

    I B 378 379 ##RFDF

    I *STATUS ##FSDF

    The File Information Data Structure for the display file supplies the following details :

    - ##FLNM : the file name of the display file

    - ##FRMT : the current record format name

    - ##LNNR : cursor position : line number

    - ##PSNR : cursor position : colomn number

    - ##RFDF : the relative record number of the subfile record

    - ##FSDF : File status code

    If other details are needed, the following procedure must be followed :

    define a data structure (400 positions) with the fields containing the information needed by the program

    move the contents of ##DSDF to the defined data structure

    use the defined fields to capture the information.

  • Manual IDDOS 13 RPG02 21 Interactive Program: Detail Description

    2.12 Data base files : File Information Data Structure

    I##DS01 DS 400

    I 38 45 ##FM01

    I 46 52 ##CP01

    I B 397 4000##RF01

    I *STATUS ##FS01

    The File Information Data Structure for a data base is unique for each file. To build the name, IDDOS uses the file number in the program. ##DSff is used for the data structure name ('ff' is replaced by the file number).

    The following information is available :

    ##FMff : the record format name of the last approached record for this file

    ##CPff : the error message ID for this file

    ##RFff : the relative record number of the last approached record for this file

    ##FSff : the file status

    If other details are needed, the following procedure can be followed :

    define a data structure (400 positions) with the fields containing the information needed by the program

    move the contents of ##DSff to the defined data structure

    use the defined fields to capture the information.

  • Manual IDDOS 13 RPG02 22 Interactive Program: Detail Description

    2.13 IDPARM : IDDOS Parameter Data Structure.

    I*----------------------------------------------------------

    I*IDDOS: Parameter Data Structure

    I*----------------------------------------------------------

    I##PARM DS 1024

    I 1 10 ##KLID

    I 176 176 ##TLCD

    I 177 177 ##TLCU

    I 178 179 ##CMDC

    I 337 337 ##DTSV

    I 368 373 ##MLTU

    I 7691024 ##UPRM

    IDDOS uses the data area IDPARM as a means of communication from one program to another. When a program is started, the contents of the data area IDPARM is retrieved and placed in the data structure ##PARM. The data area IDPARM is locked by the program.

    Before a program is ended, the contents of the data structure ##PARM is written to the data area IDPARM and the data area IDPARM is unlocked. Therefore, if information in ##PARM was changed by the program, the new information becomes available to the new program.

    Consequently, before a call to another program can be issued by the current program, the data area IDPARM must be updated and unlocked.

    The following information is available in the data structure ##PARM :

    - ##KLID : the system name

    - ##TLCD: the language code of the application system

    - ##TLCU: the language code of the user

    - ##CMDC : command key used. This will be filled automatically in future releases ('KA' for command key 1, 'KB' for command key 2,...)

  • Manual IDDOS 13 RPG02 23 Interactive Program: Detail Description

    - ##DTSV : contains the date format, found in the QDATFMT system value. 'D' = DMY 'M' = MDY 'Y' = YMD

    - ##MLTU : this is the language code of the user which is initially moved to indicators 61-66.

    - ##UPRM : this is available for the programmers to provide inter program communication, removing the need to define external parameters to the program.

  • Manual IDDOS 13 RPG02 24 Interactive Program: Detail Description

    2.14 Cursor position Conversion Data Structure.

    I*-----------------------------------------------------------

    I*IDDOS: Cursor position Conversion Data Structure

    I*-----------------------------------------------------------

    I DS

    I 1 2 ##ALF

    I B 1 20##BIN

    This data structure is used on an intermediate basis, to convert the cursor position of the display file.

    I DS

    I 1 15 ##ALFA

    I P 1 159##PACK

    This data structure is used for range testing.

  • Manual IDDOS 13 RPG02 25 Interactive Program: Detail Description

    2.15 Date Conversion Data Structures.

    I*-----------------------------------------------------------

    I*IDDOS: Date Conversion Data Structures

    I*-----------------------------------------------------------

    I##DDAT DS

    I 1 2 ##DDD

    I 3 4 ##DMM

    I 5 6 ##DYY

    I##MDAT DS

    I 1 2 ##MMM

    I 3 4 ##MDD

    I 5 6 ##MYY

    I##YDAT DS

    I 1 2 ##YYY

    I 3 4 ##YMM

    I 5 6 ##YDD

    I##CDAT DS

    I 1 1 ##CCC

    I 2 3 ##CYY

    I 4 5 ##CMM

    I 6 7 ##CDD

    IDDOS uses 4 data structures to convert dates from one format to another.

    - ##DDAT for a date in the DMY format

    - ##MDAT for a date in the MDY format

    - ##YDAT for a date in the YMD format

    - ##CDAT for a date in the CYMD format

    These data structures are present in each program dealing with automatic date conversion.

  • Manual IDDOS 13 RPG02 26 Interactive Program: Detail Description

    2.16 Keylist Section.

    C*----------------------------------------------------------

    C*IDDOS: Keylist Section

    C*----------------------------------------------------------

    C ##KL01 KLIST

    C KFLD CUCD01

    The 'Keyed file' entry on the detail screen 'files used in program' (fig 4) determines if key values are used to process this file.

    If so, IDDOS generates a key list for the file. The name of this key list is ##KLff, where 'ff' is the number of the file in the program. The key fields are composed of the move part for the field (See Chapter 'Defining and Designing Data Base Files' in 'IDDOS: General User's and Reference Guide') concatenated with the file number.

    Of course, the order of the fields in this key list is the same as the order of the keys in the external file description.

    !!! Partial key lists are not automatically provided by IDDOS, because the generator itself has no need for partial keys.

  • Manual IDDOS 13 RPG02 27 Interactive Program: Detail Description

    2.17 (Entry) Parameter list.

    C*----------------------------------------------------------

    C*IDDOS: Parameter list Section

    C*----------------------------------------------------------

    ***********************************************************

    *IDDOS: User Code : (Entry) Parameter lists

    *

    ***********************************************************

    It is considered to be good practice to group all the parameter lists, used in a program, in the same section, although this could be done anywhere in the C-specifications.

    IDDOS provides a user process point EPL to enter all the necessary parameter lists.

    - the program may need a *ENTRY parameter list

    - the program may call other programs, needing a parameter list.

  • Manual IDDOS 13 RPG02 28 Interactive Program: Detail Description

    2.18 Default Parameter lists in the program.

    C*----------------------------------------------------------

    C*IDDOS: Parameter list for HELP circuit

    C*----------------------------------------------------------

    C ##PLHT PLIST

    C PARM ##PGNM

    C PARM ##FLNM

    C PARM ##FRMT

    C PARM ##LNNR

    C PARM ##PSNR

    C PARM ##ERNR

    C PARM ##CSFL

    C*----------------------------------------------------------

    C*IDDOS: Parameter list for control field values

    C*----------------------------------------------------------

    C ##PLVR PLIST

    C PARM ##DDCD

    C PARM ##CVAL

    C PARM ##OMSC

    C PARM ##DBVL

    C PARM ##SWVR

    C*----------------------------------------------------------

    C*IDDOS: Parameter list for date conversion

    C*----------------------------------------------------------

    C ##PLDT PLIST

    C PARM ##DATI

    C PARM ##FMTI

    C PARM ##FMTO

    C PARM ##DATO

    C*----------------------------------------------------------

    C*IDDOS: Parameter list for messages

    C*----------------------------------------------------------

    C ##PLMS PLIST

    C PARM ##PGNM

    C PARM ##ERNR

    C PARM ##MESS

    C*----------------------------------------------------------

    C*IDDOS: Parameter list for error-handling

    C*----------------------------------------------------------

    C ##PLER PLIST

    C PARM ##DSDF

    C PARM ##PGDS

    C PARM ##RETN

    C*----------------------------------------------------------

    C*IDDOS: Parameterlist for list request

    C*----------------------------------------------------------

    C ##PLVA PLIST

    C PARM ##PGNM

    C PARM ##DSPF

    C PARM ##CSRC

    C PARM ##CSFL

    C PARM ##CVAL

    C PARM ##OMSC

    C PARM ##DBVL

    C PARM ##FLDN

    C*----------------------------------------------------------

    C*IDDOS: Parameterlist for first subfile line

    C*----------------------------------------------------------

    C ##PLFS PLIST

    C PARM ##FLNM

    C PARM ##KLID

    C PARM ##FMAT

    C PARM ##FLDN

    C PARM ##LYNR

    C*----------------------------------------------------------

    C*IDDOS: Parameterlist for error subfile

    C*----------------------------------------------------------

    C ##PLES PLIST

    C PARM ##F

    C PARM ##TLCU

    C PARM ##PGNM

    C*----------------------------------------------------------

    C*IDDOS: Parameterlist for date conversion (century)

    C*----------------------------------------------------------

    C ##PLCS PLIST

    C PARM ##DTIC

    C PARM ##DTOC

    C PARM ##FMFC

    C PARM ##FMOC

    C PARM ##DTSV

    C*----------------------------------------------------------

  • Manual IDDOS 13 RPG02 29 Interactive Program: Detail Description

    Each IDDOS program uses a set of parameter lists to communicate with programs in the execution environment. For test purposes, this execution environment can also be simulated in the development environment through option 40 on the IDDOS programmer menu.

    THE HELP CIRCUIT (if no UIM is used).

    The parameters used by the Execution Environment program IP250RGB (HELP) are :

    - ##PGNM : the program name

    - ##FLNM : the name of the display file

    - ##FRMT : the format name

    - ##LNNR : the line number

    - ##PSNR : the column number

    - ##ERNR : the last used error number

    - ##CSFL : the field name

    Pressing HELP will show the HELP function for the field found in the positions ##LNNR/##PSNR. If HELP is pressed on line 24/27, the second level texts (Reason/Action) for the error message are displayed.

    CHECKING VALUES AND RANGES.

    The parameters used by the Execution Environment program IP020RGB (Value/Range check) are :

    - ##DDCD : the attribute field name

    - ##CVAL : the value found on the display for the field

    - ##OMSC : the description of the value is returned in this field, if a correct value was found

    - ##DBVL : reserved for future use

    - ##SWVR : the control switch 'N' : incorrect value 'Y' : correct value

  • Manual IDDOS 13 RPG02 30 Interactive Program: Detail Description

    A value or range test can be performed. If a value was tested, and a correct value was entered in the program IP020RGB, IDDOS returns the description for this value (language-dependent) in the ##OMSC field. This description is then available to be displayed on the screen.

    DATE VALIDITY CHECK.

    The parameters used by the Execution Environment program IP030RGB (Date Validity check) are :

    - ##DATI : the date to be tested

    - ##FMTI : the format of the date to be tested. (the date format on the screen).

    - ##FMTO : the format for this date in the data base

    - ##DATO : the date in output format. If the value '999999' is returned in this parameter, the date was invalid.

    The program IP030RGB can be used to

    - perform a validity check on a date

    - reformat the date

    RETRIEVE THE ERROR MESSAGE TO BE DISPLAYED.

    The parameters used by the Execution Environment program IP010RGB (Get Error Message) are :

    - ##PGNM : the program name

    - ##ERNR : the error number

    - ##MESS : the error message text

    The program IP010RGB returns the error message description in the ##MESS field (language-dependent).

    When using error subfiles in your program, another parameter list and program are necessary (##PLES).

    - ##F : the error number to be displayed

    - ##TLCU : the language code

    - ##PGNM : the name of the program messagequeue to be used for sending the error.

  • Manual IDDOS 13 RPG02 31 Interactive Program: Detail Description

    ERROR HANDLING.

    The parameters used by the Execution Environment program IP099CLI (Error Handling) are :

    - ##DSDF : the File Information Data Structure

    - ##PGDS : the Program Status Data Structure

    - ##RETN : the return value

    The program IP099CLI is the route to the error handling circuit. An abnormal end of the calling program will be evoked because IP099CLI returns the '*CANCL' value in the ##RETN field. Only in the case of record lock, can the user return to the calling program without cancelling. In that case, blanks are returned in the ##RETN field.

    DATE CONVERSION.

    The parameters used by the date conversion program IP031RGB (Century support date conversion) are :

    - ##DTIC : the input date

    - ##DTOC : the output date

    - ##FMIC : the input date format

    - ##FMOC : the output date format

    - ##DTSV : system value QDATFMT

    The program IP031RGB performs a date check, the century is added when necessary using the AS/400 CVTDAT command. It works for dates between 1950 and 2049. If the output ##DTOC is equal to 999999, the date is incorrect.

  • Manual IDDOS 13 RPG02 32 Interactive Program: Detail Description

    RETRIEVE A VALUE BY PROMPT FUNCTION.

    This function can be automaticaly generated. This can be evoked by entering '*PROMPT' in the text field when entering command key usage. The parameters used by the Execution Environment program IP039RGI (Prompt function) are :

    - ##PGNM : the program name

    - ##DSPF : the name of the display file

    - ##CSRC : the format name

    - ##CSFL : the field name

    - ##CVAL : the value found on the display for the field

    - ##OMSC : the description of the value is returned in this field, if a correct value was found

    - ##DBVL : reserved for future use

    - ##FLDN : name of the field for which the prompt function will be processed or just was processed

    If a value was selected, IDDOS returns that value (language- dependent) in the ##CVAL field. IDDOS also returns the description for this value (language dependent) in the ##OMSC field. This description is then available to be displayed on the screen.

    If no value was selected, IDDOS moves *NONE to ##FLDN. If the cursor wasn't on a field with values IDDOS moves blanks to ##FLDN.

  • Manual IDDOS 13 RPG02 33 Interactive Program: Detail Description

    2.19 Main routine : Retrieve the data area IDPARM

    C *NAMVAR DEFN IDPARM ##PARM

    C *LOCK IN ##PARM Ext. parms

    The external data area IDPARM is linked with the data structure ##PARM through the *NAMVAR DEFN statement.

    IDDOS retrieves the value in the data area IDPARM and places the contents in the data structure ##PARM.

  • Manual IDDOS 13 RPG02 34 Interactive Program: Detail Description

    2.20 Main routine : Executing the Initialization routine

    C EXSR $I99 Initialize

    The routine $I99 must be executed to initialize the program fields.

  • Manual IDDOS 13 RPG02 35 Interactive Program: Detail Description

    2.21 Main routine : CASE routine driver.

    C ##NSBR DOWNE99

    C*

    C ##NSBR CASEQ01 $S01

    C ##NSBR CASEQ02 $S02

    C ##NSBR CASEQ03 $S03

    C END

    C*

    C END

    This is the heart of the generated program. Using CASE statements, the program drives the screen handling.

    Format number 99 must be placed in the ##NSBR field to end the program.

    For each format, defined on the 'formats used in program' screen, a CASE statement will be generated.

    Be careful, when you set the ##NSBR field to a non existing screen in user coding you create an indefinite loop.

    Fig. 6

    ..................................................................................

    : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Hotline 9.1 level 10 ID018RGI :

    : INTERACTIVE program design S03 :

    : Formats used in program . . . . . . : RV006RGI :

    : Customer Maintenance :

    : Display file name . . . . . . . . . : RV006RGD :

    : Display file UC . . . . . . . . . . . N :

    : Display file size . . . . . . . . . . 0 (0=24*80, 1=27*132) :

    : Add format number . . . . . 00 :

    : Format type . . . . . . . . :

    : :

    : Type options, press Enter. :

    : 1=Detail 4=Delete 5=Cmd keys 7=Pre-access 8=Post-access :

    : 9=Synonyms D=Description P=PPU :

    : Opt Format Next format Pointer :

    : S01FMT 01 01 :

    : :

    : :

    : :

    : :

    : :

    : :

    : EINDE :

    : F3=Exit F11=Gen. PNLGRP F12=Cancel F13=Conventions :

    : :

    :................................................................................:

  • Manual IDDOS 13 RPG02 36 Interactive Program: Detail Description

    2.22 Main routine : Super-level program drivers.

    C ##EXIT DOWEQ*BLANKS

    *

    ************************************************************

    *IDDOS: User Code : Driver routine

    *

    ************************************************************

    *---> CASE routine driver

    *

    C MOVEL'EXIT' ##EXIT

    *

    ************************************************************

    *IDDOS: User Code : End program Conditioning

    *

    ************************************************************

    *

    C END

    IDDOS has been designed to handle multiple selections, without leaving the program.

    Imagine a selection program calling a detail program to manipulate the data. After each successful manipulation, the called program has to return to the calling program. If another selection is made,

    this program calls the subprogram again. This could continue until no further selection is made. As each call to the subprogram is costing extra machine resources, it is obvious that a more efficient solution is required.

    With IDDOS for instance, we could collect several selections in a table. This table can be passed to the called program (Entry Parameter List, IDPARM,...). In the called program, within the DRV routine, this table can be processed, feeding the case routine driver with selections, without leaving the program. In the END routine, an instruction is included to blank out the ##EXIT field as long as further selections are found.

  • Manual IDDOS 13 RPG02 37 Interactive Program: Detail Description

    2.23 Main routine : The ##END TAG.

    C ##END TAG

    As a rule, IDDOS does not use the TAG statement.

    Like most rules, there is the occasional exception.

    The ##END TAG permits the programmer to quit the program from any point in the program, by issuing a jump to this program TAG. Although this is not a technique we generally advise, it can sometimes be very useful.

  • Manual IDDOS 13 RPG02 38 Interactive Program: Detail Description

    2.24 Main routine : Write Data Area IDPARM

    C OUT ##PARM

    When a program is stopped, the contents of the data structure ##PARM is written to the data area IDPARM and the data area IDPARM is unlocked.

  • Manual IDDOS 13 RPG02 39 Interactive Program: Detail Description

    2.25 Main routine : Ending the Program.

    C ##ENDP IFEQ 'LR'

    C MOVEL'1' *INLR

    C END

    C ##ENDP IFEQ 'RT'

    C RETRN

    C END

    Any program can be stopped with the LR indicator on, or with a RETRN statement, depending upon the ##ENDP field. This field can be controlled in the user code.

  • Manual IDDOS 13 RPG02 40 Interactive Program: Detail Description

    2.26 Fixed format : The Format driver.

    C*----------------------------------------------------------

    C*IDDOS: FRMT 01 : Main Driver (Fixed)

    C*----------------------------------------------------------

    C $S01 BEGSR

    C*

    C Z-ADD##NPNT ##RPNT

    C*

    C ##RPNT DOWNE99

    C*

    C ##RPNT IFEQ 1

    *--> Process action point 01

    C END

    C*

    C ##RPNT IFEQ 10

    C ##RPNT OREQ 20

    C ##RPNT OREQ 30

    *--> Process action point 30

    C END

    C*

    C ##RPNT IFEQ 40

    *--> Process action point 40

    C END

    C*

    C ##RPNT IFEQ 50

    *--> Process action point 50

    C END

    C*

    C ##RPNT IFEQ 60

    C ##RPNT OREQ 61

    C ##RPNT OREQ 62

    *--> Process action point 62

    C END

    C*

    C ##RPNT IFEQ 90

    *--> Process action point 90

    C END

    C*

    C END

    C*

    C $S01ZZ ENDSR

  • Manual IDDOS 13 RPG02 41 Interactive Program: Detail Description

    A format is processed according to the following citeria :

    --> The ##NPNT contains the pointer number to start the conversation for the format concerned. The value in ##NPNT is placed in the ##RPNT field.

    --> The ##RPNT field will be used to drive the format handling. It will execute an automatic routing, increasing the value found in the ##RPNT field, until the value 99 is reached. If there is no intervention in the user process points, or with command key entries, the do-while driver stops the handling of this format, and gives control back to the program main driver.

    The following process points are available for a fixed format :

    - pointer 01 : The initial processing for the format, including the user process point Vnn.

    - pointer 10 : This pointer will perform the same actions as intended for pointer 30.

    - pointer 20 : This pointer will perform the same actions as intended for pointer 30.

    - pointer 30 : Blanking out the message field, or retrievingthe message text, including the user proces point Dnn.

    - pointer 40 : Displaying the format.

    - pointer 50 : Processing the command keys

    --> Help (whithout UIM)

    --> Command key 24

    --> Command key(s) *PROMPT function

    --> user process point Cnn

    - pointer 60 : This pointer will perform the same actions as intended for pointer 62.

    - pointer 61 : This pointer will perform the same actions as intended for pointer 62.

    - pointer 62 : User process point Pnn

    - pointer 90 : End-format processing

  • Manual IDDOS 13 RPG02 42 Interactive Program: Detail Description

    2.27 Fixed Format : Pointer 01.

    C ##RPNT IFEQ 1

    C Z-ADD10 ##RPNT

    C Z-ADD0 ##INSL

    C EXSR $V01 Pre-Display

    C END

    Within Pointer 01 processing :

    ##RPNT will be set to value 10

    ##INSL will be initialized. ##INSL is the number of the command key line to be displayed. The programmer can assign a value to this field in the pre-display processing (Vnn) to decide which command key line to display. If no value is assigned, the generator will automatically display the first command key line.

    The routine $Vnn will be executed. This routine comprises the pre-display data base accesses, followed by the user code, found in process point Vnn.

  • Manual IDDOS 13 RPG02 43 Interactive Program: Detail Description

    2.28 Fixed Format : Pointer 10-20-30. Whithout error subfile

    C ##RPNT IFEQ 10

    C ##RPNT OREQ 20

    C ##RPNT OREQ 30

    C Z-ADD40 ##RPNT

    C Z-ADD##F ##ERNR

    C ##F IFEQ 0

    C MOVEL*BLANKS ##MESS

    C ELSE

    C OUT ##PARM

    C CALL 'IP010RGB'##PLMS

    C *LOCK IN ##PARM

    C Z-ADD0 ##F

    C END

    C EXSR $D01

    C END

    Within Pointer 30 processing :

    ##RPNT will be set to value 40

    ##F will be evaluated : This is the message number of the message to be displayed. If this ##F field contains a value 0, ##MESS will be blanked out, otherwise the message text for the message number will be retrieved and placed in the ##MESS field.

  • Manual IDDOS 13 RPG02 44 Interactive Program: Detail Description

    2.29 Fixed Format : Pointer 10-20-30. With error subfile

    C ##RPNT IFEQ 10

    C ##RPNT OREQ 20

    C ##RPNT OREQ 30

    C Z-ADD40 ##RPNT

    C ##F IFEQ 0

    C CALL 'IP060CLB'##PLES

    C Z-ADD0 ##F

    C END

    C EXSR $D01

    C END

    Within Pointer 30 processing :

    ##RPNT will be set to value 40

    ##F will be evaluated : This is the message number of the message to be displayed. If this ##F field contains a value 0, nothing happens, otherwise the message with error number ##F is sent to the program messagequeue.

  • Manual IDDOS 13 RPG02 45 Interactive Program: Detail Description

    2.30 Fixed Format : Pointer 40.

    C ##RPNT IFEQ 40

    C Z-ADD50 ##RPNT

    C*

    C ##PREV IFNE 01 No Redisplay

    C MOVEL'0' *IN81

    C MOVEL'0' *IN82

    C MOVEL'0' *IN91

    C ELSE Same screen

    C MOVEL'1' *IN81

    C MOVEL'1' *IN82

    C MOVEL'1' *IN91

    C ##NEW IFEQ '0'

    C MOVEL'1' ##NEW

    C MOVEL'0' *IN81

    C END

    C END

    C*

    C ##OVRL IFEQ '0'

    C MOVEL'0' *IN92

    C ELSE

    C MOVEL'1' *IN92

    C END

    C*

    C ##INSL IFLT 1

    C ##INSL ORGT 1

    C Z-ADD1 ##INSL

    C END Messages

    C*

    C WRITEM99CTL Error subfile

    C MOVEL'1' *IN92 Error subfile

    C*

    C ##INSL IFEQ 1

    C WRITES01IL1

    C END

    C*

    C MOVEL'1' *IN92

    C Z-ADD01 ##PREV

    C EXFMTS01FMT

    C MOVEL'0' *IN81 Reset 1

    C MOVEL'0' *IN82

    C MOVEL'0' *IN91

    C*

    C END

  • Manual IDDOS 13 RPG02 46 Interactive Program: Detail Description

    Within pointer 40 processing :

    ##RPNT will be set to value 50

    ##PREV will be evaluated. This contains the number of the previously displayed format. If this previously displayed format differs from the one to be sent, all data and constants will be sent. If the same format is to be redisplayed, the PUTOVR condition will be activated (indicators 81,82,91 on). In that case, only output and both fields will be redisplayed by IDDOS. If there is no need to redisplay the output fields, the programmer must assign a value '0' to the ##NEW field, and indicator 81 will then be set to off.

    ##OVRL will be evaluated. This is the switch to decide whether or not to activate the overlay condition. This field is controlled by the generator.

    ##INSL will be evaluated. This is the field containing the number of the command key line to be displayed. If this field contains a value less than 1, or larger than the highest possible number of command key line for this format, it will be reset to the value 1. IDDOS will then send the appropriate message line.

    When using error subfile, the control format of the error subfile is written.

    The display format will be displayed and the ##PREV field will be updated

  • Manual IDDOS 13 RPG02 47 Interactive Program: Detail Description

    2.31 Fixed Format : Pointer 50. Whithout UIM help

    C ##RPNT IFEQ 50

    C Z-ADD60 ##RPNT

    C*

    C *IN99 DOWEQ'1' HELP

    C *INKY OREQ '1' CF24

    C *INKD OREQ '1' *PROMPT

    C *IN99 IFEQ '1'

    C *INKD OREQ '1'

    C MOVE ##LNNR ##ALF

    C Z-ADD##BIN ##LINE

    C MOVE ##PSNR ##ALF

    C Z-ADD##BIN ##POS

    C Z-ADD0 ##PREV

    C END

    C *IN99 IFEQ '1'

    C OUT ##PARM

    C CALL 'IP250RGB'##PLHT

    C *LOCK IN ##PARM

    C MOVEL'0' *IN99

    C MOVEL'1' *IN91

    C END

    C *INKY IFEQ '1'

    C MOVEL'1' *IN91

    C ##OVRL IFEQ '0'

    C MOVEL'0' *IN92

    C ELSE

    C MOVEL'1' *IN92

    C END

    C ADD 1 ##INSL

    C ##INSL IFLT 1

    C ##INSL ORGT 1

    C Z-ADD1 ##INSL

    C END

    C ##INSL IFEQ 1

    C WRITES01IL1

    C END

    C END

    C *INKD IFEQ '1'

    C EXSR PR0104

    C ##SWPR IFEQ 'Y'

    C OUT ##PARM

    C CALL 'IP039RGI'##PLVA

    C *LOCK IN ##PARM

    C ##FLDN IFEQ *BLANKS

    C Z-ADD30 ##RPNT

    C Z-ADD996 ##F

    C END

    C ##FLDN IFNE '*NONE '

    C ##FLDN IFEQ 'ACCD#1'

    C MOVEL##CVAL ACCD#1

    C END

    C ##FLDN IFEQ 'COCD#1'

    C MOVEL##CVAL COCD#1

    C END

    C END

    C ELSE

    C MOVEL'Y' ##SWPR

    C END

    C *INKD IFEQ '1'

    C EXSR PS0104

    C END

    C MOVEL'1' *IN91

    C MOVEL'1' *IN82

    C MOVEL'1' *IN81

    C*

    C Z-ADD##F ##ERNR

    C ##F IFEQ 0

    C MOVEL*BLANKS ##MESS

    C ELSE

    C OUT ##PARM

    C CALL 'IP010RGB'##PLMS

    C *LOCK IN ##PARM

    C Z-ADD0 ##F

    C END

    C ##OVRL IFEQ '0'

    C MOVEL'0' *IN92

    C ELSE

    C MOVEL'1' *IN92

  • Manual IDDOS 13 RPG02 48 Interactive Program: Detail Description

    C END

    C ##INSL IFEQ 1

    C WRITES01IL1

    C END

    C END

    C*

    C MOVEL'1' *IN92

    C WRITES01FMT

    C READ S01FMT 89

    C END

    C*

    C*

    C MOVEL'0' *IN91 Reset 2

    C MOVEL'0' *IN92

    C Z-ADD0 ##LINE

    C Z-ADD0 ##POS

    C MOVEA##I *IN,1

    C CALL 'IP061CLB' Error subfile

    C*

    C EXSR $C01 Cmd-keys

    C*

    C END

    Within pointer 50 processing :

    ##RPNT will be set to value 60

    Help processing is available : If indicator 99 is in effect (Help key was pressed), the help circuit is activated through the call of the program IP250RGB. Afterwards, the format will be redisplayed. If you use UIM help, the help function is handled by OS/400, the display file and the panel group object.

    Command key 24 processing is available : If command key 24 was pressed, the scrolling of the command key panel can be performed. IDDOS will display the next command key line. If there are no further command key lines, the first command key line will be displayed, and scrolling can be restarted.

    Command key to process *PROMPT function is available : If the command key was pressed and the cursor was placed on a field that was not linked to a value table, IDDOS will retrieve the error message with number 966 to be displayed. If the command key was pressed and the cursor was placed on a field that was linked to a value table, IDDOS will call IP039RGI to select a value.

    The ##I table will overwrite the first 50 indicators in the program.

    The routine $Cnn will be executed. This routine comprises the user code in the process point Cnn, followed by the generated command key processing.

  • Manual IDDOS 13 RPG02 49 Interactive Program: Detail Description

    2.32 Fixed Format : Pointer 50. With UIM help

    C ##RPNT IFEQ 50

    C Z-ADD60 ##RPNT

    C*

    C MOVEL'0' *IN91 Reset 2

    C MOVEL'0' *IN92

    C Z-ADD0 ##LINE

    C Z-ADD0 ##POS

    C MOVEA##I *IN,1

    C CALL 'IP061CLB' Error subfile

    C*

    C EXSR $C01 Cmd-keys

    C*

    C END

    Within pointer 50 processing :

    ##RPNT will be set to value 60

    The program error messagequeue will be cleared.

    The ##I table will overwrite the first 50 indicators in the program.

    The routine $Cnn will be executed. This routine comprises the user code in the process point Cnn, followed by the generated command key processing.

    If you use UIM help, the help function is handled by OS/400, the display file and the panel group object.

  • Manual IDDOS 13 RPG02 50 Interactive Program: Detail Description

    2.33 Fixed Format : Pointer 60-61-62.

    C ##RPNT IFEQ 60

    C ##RPNT OREQ 61

    C ##RPNT OREQ 62

    C Z-ADD90 ##RPNT

    C EXSR $P01 Post-Display

    C*

    C MOVEL'0' ##AD01

    C MOVEL'0' ##UP01

    C MOVEL'0' ##DL01

    C END

    Within pointer 62 processing :

    ##RPNT will be set to value 90

    The routine $Pnn will be executed. This routine comprises the user code in the process point Pnn, followed by the generated post-display data base accesses.

    the add, update, and delete flags will be reset.

  • Manual IDDOS 13 RPG02 51 Interactive Program: Detail Description

    2.34 Fixed Format : Pointer 90.

    C ##RPNT IFEQ 90

    C Z-ADD99 ##RPNT

    C*

    C ##TF99 IFNE 0

    C Z-ADD##TF99 ##NSBR

    C Z-ADD0 ##TF99

    C Z-ADD61 ##NPNT

    C ELSE

    C MOVEL'0' ##OVRL

    C Z-ADD##NSBR ##PSBR

    C Z-ADD##NPNT ##PPNT

    C Z-ADD02 ##NSBR

    C Z-ADD01 ##NPNT

    C END

    C*

    C END

    Within pointer 90 processing :

    ##RPNT will be set to value 99

    Field ##TF99 is checked for a value. This indicates that the screen was displayed as a result of a selection in a subfile. This mechanism will be discussed further on.

    The field ##NSBR will be given the value, entered in the next-format field on the detail definition of this format.

  • Manual IDDOS 13 RPG02 52 Interactive Program: Detail Description

    2.35 Subfile Format: The Format driver.

    C*----------------------------------------------------------

    C*IDDOS: FRMT 03 : Main Driver (Subfile)

    C*----------------------------------------------------------

    C $S03 BEGSR

    C*

    C Z-ADD##NPNT ##RPNT

    C*

    C ##RPNT DOWNE99

    C*

    C ##RPNT IFEQ 1

    *--> Process action point 01

    C END

    C*

    C ##RPNT IFEQ 10

    *--> Process action point 10

    C END

    C*

    C ##RPNT IFEQ 20

    *--> Process action point 20

    C END

    C*

    C ##RPNT IFEQ 30

    *--> Process action point 30

    C END

    C*

    C ##RPNT IFEQ 40

    *--> Process action point 40

    C END

    C*

    C ##RPNT IFEQ 50

    *--> Process action point 50

    C END

    C*

    C ##RPNT IFEQ 60

    *--> Process action point 60

    C END

    C*

    C ##RPNT IFEQ 61

    *--> Process action point 61

    C END

    C*

    C ##RPNT OREQ 62

    *--> Process action point 62

    C END

    C*

    C ##RPNT IFEQ 90

    *--> Process action point 90

    C END

    C*

    C END

    C*

    C $S03ZZ ENDSR

  • Manual IDDOS 13 RPG02 53 Interactive Program: Detail Description

    The processing criteria for a subfile are the same as those for a fixed format.

    The following process points are available for a subfile format :

    - pointer 01 : the initial processing for the format, including the user process point Vnn.

    - pointer 10 : SETLL of the based-on file for the subfile, SFLCLR for the subfile

    - pointer 20 : Load 1 subfile page, including the user process points Inn, Rnn and Ann.

    - pointer 30 : blanking out of the message field, or retrieving the message text, including the user proces point Dnn.

    - pointer 40 : Displaying the format.

    - pointer 50 : Processing the command keys

    --> Help (Whithout UIM)

    --> Command key 24

    --> Roll up

    --> user process point Cnn

    - pointer 60 : processing for the control record, including user process point Lnn.

    - pointer 61 : READC processing for the subfile, including user process point Xnn.

    - pointer 62 : user process point Pnn

    - pointer 90 : end-format proccessing

  • Manual IDDOS 13 RPG02 54 Interactive Program: Detail Description

    2.36 Subfile Format : Pointer 01.

    C ##RPNT IFEQ 1

    C Z-ADD10 ##RPNT

    C Z-ADD0 ##INSL

    C EXSR $V03 Pre-Display

    C END

    Pointer 01 processing is the same as that for a fixed format.

  • Manual IDDOS 13 RPG02 55 Interactive Program: Detail Description

    2.37 Subfile Format : Pointer 10.

    C ##RPNT IFEQ 10

    C Z-ADD20 ##RPNT

    C*

    C MOVEL'1' *IN97

    C WRITES03CTL SFLCLR

    C MOVEL'0' *IN97

    C*

    C Z-ADD0 ##RN03

    C Z-ADD0 ##RH03

    C MOVEL'N' ##ES03

    C MOVEL'N' ##EF03

    C MOVEL'N' ##RA03

    C