TABLE OF CONTENTS RPG02: INTERACTIVE PROGRAM : DETAIL DESCRIPTION. ..................................................................... 1 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.35 2.36 2.37 2.38 2.39 2.40 2.41 2.42 2.43 2.44 2.45 2.46 2.47 2.48 2.49 2.50 2.51 2.52 2.53 2.54 2.55 THE EXAMPLE PROGRAM : DESCRIPTION. ....................................................................................................... 2 THE EXAMPLE PROGRAM : TECHNICAL ANALYSIS. ........................................................................................ 6 THE EXAMPLE PROGRAM : DISPLAY FILE. ...................................................................................................... 7 PROGRAM HEADER......................................................................................................................................... 9 THE H-SPECIFICATION. ................................................................................................................................. 11 THE DISPLAY FILE. ....................................................................................................................................... 12 FILES USED IN THE PROGRAM. ...................................................................................................................... 14 INITIAL INDICATOR TABLE. .......................................................................................................................... 17 ADDITIONAL E- AND I-SPECIFICATIONS. ....................................................................................................... 18 THE PROGRAM STATUS DATA STRUCTURE. ................................................................................................. 19 DISPLAY FILE : FILE INFORMATION DATA STRUCTURE ................................................................................ 20 DATA BASE FILES : FILE INFORMATION DATA STRUCTURE .......................................................................... 21 IDPARM : IDDOS PARAMETER DATA STRUCTURE. ................................................................................... 22 CURSOR POSITION CONVERSION DATA STRUCTURE. .................................................................................... 24 DATE CONVERSION DATA STRUCTURES. ..................................................................................................... 25 KEYLIST SECTION......................................................................................................................................... 26 (ENTRY) PARAMETER LIST. .......................................................................................................................... 27 DEFAULT PARAMETER LISTS IN THE PROGRAM............................................................................................. 28 MAIN ROUTINE : RETRIEVE THE DATA AREA IDPARM ................................................................................ 33 MAIN ROUTINE : EXECUTING THE INITIALIZATION ROUTINE ........................................................................ 34 MAIN ROUTINE : CASE ROUTINE DRIVER. .................................................................................................... 35 MAIN ROUTINE : SUPER-LEVEL PROGRAM DRIVERS. ..................................................................................... 36 MAIN ROUTINE : THE ##END TAG. ............................................................................................................. 37 MAIN ROUTINE : WRITE DATA AREA IDPARM ........................................................................................... 38 MAIN ROUTINE : ENDING THE PROGRAM. ..................................................................................................... 39 FIXED FORMAT : THE FORMAT DRIVER. ........................................................................................................ 40 FIXED FORMAT : POINTER 01. ...................................................................................................................... 42 FIXED FORMAT : POINTER 10-20-30. ............................................................................................................ 43 FIXED FORMAT : POINTER 10-20-30. ............................................................................................................ 44 FIXED FORMAT : POINTER 40. ...................................................................................................................... 45 FIXED FORMAT : POINTER 50. ...................................................................................................................... 47 FIXED FORMAT : POINTER 50. ...................................................................................................................... 49 FIXED FORMAT : POINTER 60-61-62. ............................................................................................................ 50 FIXED FORMAT : POINTER 90. ...................................................................................................................... 51 SUBFILE FORMAT: THE FORMAT DRIVER...................................................................................................... 52 SUBFILE FORMAT : POINTER 01. ................................................................................................................... 54 SUBFILE FORMAT : POINTER 10. ................................................................................................................... 55 SUBFILE FORMAT : POINTER 20. ................................................................................................................... 56 SUBFILE FORMAT : POINTER 30. ................................................................................................................... 58 SUBFILE FORMAT : POINTER 10-20-30. ........................................................................................................ 59 SUBFILE FORMAT : POINTER 40. ................................................................................................................... 60 SUBFILE FORMAT : POINTER 50. ................................................................................................................... 61 SUBFILE FORMAT : POINTER 50. ................................................................................................................... 63 SUBFILE FORMAT : POINTER 60. ................................................................................................................... 65 SUBFILE FORMAT : POINTER 61. ................................................................................................................... 66 SUBFILE FORMAT : POINTER 62. ................................................................................................................... 67 SUBFILE FORMAT : POINTER 90. ................................................................................................................... 68 USER CODE : PRE-DISPLAY. .......................................................................................................................... 69 USER CODE : INITIALIZE SUBFILE RECORD. .................................................................................................. 70 USER CODE : SUBFILE RECORD CONTROL. .................................................................................................... 71 USER CODE : ADDITIONAL PROCESSING ON SUBFILE RECORD. .................................................................... 72 USER CODE : DISPLAY NAVIGATION CONTROL. ............................................................................................ 73 USER CODE : COMMAND-KEYS..................................................................................................................... 74 USER CODE : SUBFILE GENERAL HANDLING. ................................................................................................ 75 USER CODE : SUBFILE DETAIL HANDLING. ................................................................................................... 76 2.56 2.57 2.58 2.59 2.60 2.61 2.62 2.63 2.64 2.65 2.66 2.67 2.68 2.69 2.70 2.71 2.72 2.73 2.74 2.75 2.76 2.77 2.78 2.79 USER CODE : POST-DISPLAY. ........................................................................................................................ 77 THE PROGRAM INITIALIZATION ROUTINE. .................................................................................................... 78 THE PROGRAM ERROR HANDLING ROUTINE. ................................................................................................ 81 USER WRITTEN SUBROUTINES. ..................................................................................................................... 82 FILE HANDLING : TRANSFER FILE --> SCREEN .............................................................................................. 83 FILE HANDLING : TRANSFER SCREEN --> FILE .............................................................................................. 84 FILE HANDLING : INITIALIZE NON-KEY FIELDS. ............................................................................................ 85 FILE HANDLING : FILL KEYLIST. ................................................................................................................... 86 DATE CONVERSION ROUTINE. ....................................................................................................................... 87 PROGRAM TABLES. ....................................................................................................................................... 89 PRE-DISPLAY DATA BASE ACCESSES. ............................................................................................................ 90 POST-DISPLAY DATA BASE ACCESSES. .......................................................................................................... 92 USER ASSIST CODE : CHECKING VALUES AND RANGES. ................................................................................ 94 USER ASSIST CODE : FILECHECK. ................................................................................................................. 97 USER ASSIST CODE : CHECKING VALIDITY OF DATES. .................................................................................. 99 COMMAND KEY PROCESSING. ..................................................................................................................... 102 DISPLAYING ERRORS ON THE SCREEN. ........................................................................................................ 106 HANDLING MORE THAN ONE ERROR ON A SCREEN. ..................................................................................... 107 HANDLING A GROUP OF RECORDS TO LOAD A SUBFILE. .............................................................................. 108 THE ##TF99 FIELD. .................................................................................................................................... 109 CALLING ANOTHER PROGRAM. ................................................................................................................... 110 PROGRAM INDICATORS. .............................................................................................................................. 111 PROGRAM ROUTINES. ................................................................................................................................. 112 PROGRAM FIELDS. ...................................................................................................................................... 114 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 Interactive Program: Detail Description 1 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 Interactive Program: Detail Description 2 Screen 1 : Key Prompt. 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 .... ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7. MANUAL IDDOS MN001RGI S01FMT 00/00/00 00:00:00 Customer Code: BBBBB F04=Selection F03=Exit F12=Cancel 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 Interactive Program: Detail Description 3 Screen 2 : Detail Maintenance screen. 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 .... ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7. MANUAL IDDOS MN001RGI S02FMT 00/00/00 00:00:00 Customer Code: OOOOO Customer Name: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB Customer Address: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB Customer Zip Code: BBBBBBBB Customer City: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB Customer Date: 999999 Customer Activity Code: B OOOOOOOOOOOOOOOOOOOOOOOOOOO F11=Delete F03=Exit F12=Cancel 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 Interactive Program: Detail Description 4 Screen 3 : Selection Screen. 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 .... ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7. MANUAL IDDOS MN001RGI S03SFL 00/00/00 00:00:00 Type Options, press Enter 1=Select Opt B B B B B B B B B B B B Name OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO Code OOOOO OOOOO OOOOO OOOOO OOOOO OOOOO OOOOO OOOOO OOOOO OOOOO OOOOO OOOOO F03=Exit F12=Cancel 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 Interactive Program: Detail Description 5 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 Interactive Program: Detail Description 6 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 Interactive Program: Detail Description 7 − 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 Interactive Program: Detail Description 8 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 Interactive Program: Detail Description 9 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 Interactive Program: Detail Description 10 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 Interactive Program: Detail Description 11 2.6 The Display File. FMN001RGDCF F F E WORKSTN KINFDS ##DSDF KINFSR *PSSR ##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 Interactive Program: Detail Description 12 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 Interactive Program: Detail Description 13 2.7 Files used in the program. FMNCUMAL1UF F F E K DISK A KINFDS ##DS01 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 Interactive Program: Detail Description 14 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 Interactive Program: Detail Description 15 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 Interactive Program: Detail Description 16 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 Interactive Program: Detail Description 17 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 Interactive Program: Detail Description 18 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 Interactive Program: Detail Description 19 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 Interactive Program: Detail Description 20 2.12 Data base files : File Information Data Structure I##DS01 I I I I DS 400 38 45 ##FM01 46 52 ##CP01 B 397 4000##RF01 *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 Interactive Program: Detail Description 21 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 : Manual IDDOS 13 - ##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,...) RPG02 Interactive Program: Detail Description 22 Manual IDDOS 13 - ##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. RPG02 Interactive Program: Detail Description 23 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 I I DS P 1 1 15 ##ALFA 159##PACK This data structure is used for range testing. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 24 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 Interactive Program: Detail Description 25 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 Interactive Program: Detail Description 26 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 Interactive Program: Detail Description 27 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 Interactive Program: Detail Description 28 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 Interactive Program: Detail Description 29 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). Manual IDDOS 13 - ##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. RPG02 Interactive Program: Detail Description 30 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 Interactive Program: Detail Description 31 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 Interactive Program: Detail Description 32 2.19 Main routine : Retrieve the data area IDPARM C C *NAMVAR *LOCK DEFN IDPARM IN ##PARM ##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 Interactive Program: Detail Description 33 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 Interactive Program: Detail Description 34 2.21 Main routine : CASE routine driver. C C* C C C C C* C ##NSBR DOWNE99 ##NSBR ##NSBR ##NSBR CASEQ01 CASEQ02 CASEQ03 END $S01 $S02 $S03 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 Interactive Program: Detail Description 35 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 Interactive Program: Detail Description 36 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 Interactive Program: Detail Description 37 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 Interactive Program: Detail Description 38 2.25 Main routine : Ending the Program. C C C C C C ##ENDP ##ENDP IFEQ 'LR' MOVEL'1' END IFEQ 'RT' RETRN END *INLR 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 Interactive Program: Detail Description 39 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 Interactive Program: Detail Description 40 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 Interactive Program: Detail Description 41 2.27 Fixed Format : Pointer 01. C C C C C ##RPNT IFEQ 1 Z-ADD10 Z-ADD0 EXSR $V01 END ##RPNT ##INSL Pre-Display 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 Interactive Program: Detail Description 42 2.28 Fixed Format : Pointer 10-20-30. Whithout error subfile C C C C C C C C C C C C C C C ##RPNT ##RPNT ##RPNT ##F *LOCK IFEQ 10 OREQ 20 OREQ 30 Z-ADD40 ##RPNT Z-ADD##F ##ERNR IFEQ 0 MOVEL*BLANKS ##MESS ELSE OUT ##PARM CALL 'IP010RGB'##PLMS IN ##PARM Z-ADD0 ##F END EXSR $D01 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 Interactive Program: Detail Description 43 2.29 Fixed Format : Pointer 10-20-30. With error subfile C C C C C C C C C C ##RPNT ##RPNT ##RPNT ##F IFEQ 10 OREQ 20 OREQ 30 Z-ADD40 ##RPNT IFEQ 0 CALL 'IP060CLB'##PLES Z-ADD0 ##F END EXSR $D01 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 Interactive Program: Detail Description 44 2.30 Fixed Format : Pointer 40. C C C* C C C C C C C C C C C C C C* C C C C C C* C C C C C* C C C* C C C C* C C C C C C C* C Manual IDDOS 13 ##RPNT IFEQ 40 Z-ADD50 ##PREV IFNE 01 MOVEL'0' MOVEL'0' MOVEL'0' ELSE MOVEL'1' MOVEL'1' MOVEL'1' IFEQ '0' MOVEL'1' MOVEL'0' END END ##NEW ##OVRL ##INSL ##INSL IFEQ '0' MOVEL'0' ELSE MOVEL'1' END IFLT 1 ORGT 1 Z-ADD1 END WRITEM99CTL MOVEL'1' ##INSL ##RPNT No Redisplay *IN81 *IN82 *IN91 Same screen *IN81 *IN82 *IN91 ##NEW *IN81 *IN92 *IN92 ##INSL Messages *IN92 Error subfile Error subfile IFEQ 1 WRITES01IL1 END MOVEL'1' Z-ADD01 EXFMTS01FMT MOVEL'0' MOVEL'0' MOVEL'0' *IN92 ##PREV *IN81 *IN82 *IN91 Reset 1 END RPG02 Interactive Program: Detail Description 45 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 Interactive Program: Detail Description 46 2.31 Fixed Format : Pointer 50. Whithout UIM help C C C* C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C* C C C C C C C C C C C C C Manual IDDOS 13 ##RPNT *IN99 *INKY *INKD *IN99 *INKD *IN99 *LOCK *INKY ##OVRL ##INSL ##INSL ##INSL *INKD ##SWPR *LOCK ##FLDN ##FLDN ##FLDN ##FLDN *INKD ##F *LOCK ##OVRL IFEQ 50 Z-ADD60 ##RPNT DOWEQ'1' OREQ '1' OREQ '1' IFEQ '1' OREQ '1' MOVE ##LNNR ##ALF Z-ADD##BIN ##LINE MOVE ##PSNR ##ALF Z-ADD##BIN ##POS Z-ADD0 ##PREV END IFEQ '1' OUT ##PARM CALL 'IP250RGB'##PLHT IN ##PARM MOVEL'0' *IN99 MOVEL'1' *IN91 END IFEQ '1' MOVEL'1' *IN91 IFEQ '0' MOVEL'0' *IN92 ELSE MOVEL'1' *IN92 END ADD 1 ##INSL IFLT 1 ORGT 1 Z-ADD1 ##INSL END IFEQ 1 WRITES01IL1 END END IFEQ '1' EXSR PR0104 IFEQ 'Y' OUT ##PARM CALL 'IP039RGI'##PLVA IN ##PARM IFEQ *BLANKS Z-ADD30 ##RPNT Z-ADD996 ##F END IFNE '*NONE ' IFEQ 'ACCD#1' MOVEL##CVAL ACCD#1 END IFEQ 'COCD#1' MOVEL##CVAL COCD#1 END END ELSE MOVEL'Y' ##SWPR END IFEQ '1' EXSR PS0104 END MOVEL'1' *IN91 MOVEL'1' *IN82 MOVEL'1' *IN81 HELP CF24 *PROMPT Z-ADD##F ##ERNR IFEQ 0 MOVEL*BLANKS ##MESS ELSE OUT ##PARM CALL 'IP010RGB'##PLMS IN ##PARM Z-ADD0 ##F END IFEQ '0' MOVEL'0' *IN92 ELSE MOVEL'1' *IN92 RPG02 Interactive Program: Detail Description 47 C C C C C C* C C C C C* C* C C C C C C C* C C* C ##INSL END IFEQ 1 WRITES01IL1 END END MOVEL'1' WRITES01FMT READ S01FMT END *IN92 89 MOVEL'0' *IN91 MOVEL'0' *IN92 Z-ADD0 ##LINE Z-ADD0 ##POS MOVEA##I *IN,1 CALL 'IP061CLB' Reset 2 Error subfile EXSR $C01 Cmd-keys 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 Interactive Program: Detail Description 48 2.32 Fixed Format : Pointer 50. With UIM help C C C* C C C C C C C* C C* C ##RPNT IFEQ 50 Z-ADD60 ##RPNT MOVEL'0' *IN91 MOVEL'0' *IN92 Z-ADD0 ##LINE Z-ADD0 ##POS MOVEA##I *IN,1 CALL 'IP061CLB' Reset 2 EXSR $C01 Cmd-keys Error subfile 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 Interactive Program: Detail Description 49 2.33 Fixed Format : Pointer 60-61-62. C C C C C C* C C C C ##RPNT ##RPNT ##RPNT IFEQ 60 OREQ 61 OREQ 62 Z-ADD90 EXSR $P01 MOVEL'0' MOVEL'0' MOVEL'0' END ##RPNT Post-Display ##AD01 ##UP01 ##DL01 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 Interactive Program: Detail Description 50 2.34 Fixed Format : Pointer 90. C C C* C C C C C C C C C C C C* C ##RPNT ##TF99 IFEQ 90 Z-ADD99 IFNE 0 Z-ADD##TF99 Z-ADD0 Z-ADD61 ELSE MOVEL'0' Z-ADD##NSBR Z-ADD##NPNT Z-ADD02 Z-ADD01 END ##RPNT ##NSBR ##TF99 ##NPNT ##OVRL ##PSBR ##PPNT ##NSBR ##NPNT 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 Interactive Program: Detail Description 51 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 *--> Process action C C* C C* C $S03ZZ Manual IDDOS 13 IFEQ 90 point 90 END END ENDSR RPG02 Interactive Program: Detail Description 52 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 Interactive Program: Detail Description 53 2.36 Subfile Format : Pointer 01. C C C C C ##RPNT IFEQ 1 Z-ADD10 Z-ADD0 EXSR $V03 END ##RPNT ##INSL Pre-Display Pointer 01 processing is the same as that for a fixed format. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 54 2.37 Subfile Format : Pointer 10. C C C* C C C C* C C C C C C C* C C C C C C C C* C ##RPNT ##KL02 *IN87 ##ST03 IFEQ 10 Z-ADD20 ##RPNT MOVEL'1' WRITES03CTL MOVEL'0' *IN97 Z-ADD0 Z-ADD0 MOVEL'N' MOVEL'N' MOVEL'N' MOVEL'N' ##RN03 ##RH03 ##ES03 ##EF03 ##RA03 ##NDSP SETLLMNCUMAR2 IFEQ '1' MOVEL'Y' IFEQ 'Y' MOVEL'Y' END END SFLCLR *IN97 87 ##EF03 ##ES03 END Within pointer 10 processing : − ##RPNT will be set to value 20. − The subfile is cleared. − Fields ##RNnn, ##RHnn, ##ESnn, ##EFnn, ##RAnn, ##NDSPare initialised. − There is a SETLL of the based-on file. A starting value for the key list can be set in the Vnn routine (or any other routine in the program). Manual IDDOS 13 RPG02 Interactive Program: Detail Description 55 2.38 Subfile Format : Pointer 20. C C C* C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C* C C C C* C C C* C C C C C C C C C C C C C C C C C C C C C C C C C C* C Manual IDDOS 13 ##RPNT ##SFLL ##EF03 *IN89 ##ST03 ##ES03 ##EF03 ##NDSP ##NDSP ##EF03 ##ES03 ##EF03 ##SWES *IN89 ##ST03 ##NDSP ##EF03 IFEQ 20 Z-ADD30 Z-ADD0 DOWLT12 IFEQ 'N' READ MNCUMAR2 IFEQ '1' MOVEL'Y' IFEQ 'Y' MOVEL'Y' END END END IFEQ 'Y' Z-ADD12 ELSE IFEQ 'Y' MOVEL'N' EXSR $B02 EXSR $I03 ELSE EXSR $R03 IFEQ 'N' EXSR $F02 EXSR $A03 END END IFEQ 'N' ADD 1 ADD 1 WRITES03SFL ELSE MOVEL'N' END END END ##RPNT ##SFLL SFLLOAD N ##ES03 ##SFLL ##NDSP ##RN03 ##SFLL ##NDSP IFEQ 'N' MOVELCUNMCU END ##0103 Z-ADD##RN03 Z-ADD##RN03 ##RS03 ##RH03 IFEQ 'N' ANDEQ'N' Z-ADD##RF02 MOVEL*BLANKS DOWEQ*BLANKS READ MNCUMAR2 IFEQ '1' MOVEL'S' MOVEL'Y' IFEQ 'Y' MOVEL'Y' END ELSE EXSR $R03 IFEQ 'Y' MOVEL'N' ELSE MOVEL'S' END IFEQ 'Y' MOVEL'S' END END END END 89 ##EF03 SAVE KEYS SET RRN Subfile End? ##RL03 ##SWES 89 ##SWES ##EF03 ##ES03 ##NDSP ##SWES ##SWES END RPG02 Interactive Program: Detail Description 56 Within pointer 20 processing : − ##RPNT will be set to value 30 − 1 page of the subfile is loaded including : Inn to load initial records Rnn for record control Ann for additional code for records from the based-on file − If the based on file is used in update, the read is a read whithout lock. − The based-on file keys of the last record present the subfile, are saved. − The last RRN in the subfile is saved to ##RSnn, ##RHnn. − There is a check to see if any valid records are to be loaded on the next page of the subfile (to control SFLEND). Manual IDDOS 13 RPG02 Interactive Program: Detail Description 57 2.39 Subfile Format : Pointer 30. Whithout error subfile C C C C C C C C C C C C C ##RPNT ##F *LOCK IFEQ 30 Z-ADD40 ##RPNT Z-ADD##F ##ERNR IFEQ 0 MOVEL*BLANKS ##MESS ELSE OUT ##PARM CALL 'IP010RGB'##PLMS IN ##PARM Z-ADD0 ##F END EXSR $D03 END Pointer 30 processing is the same as that for a fixed format. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 58 2.40 Subfile Format : Pointer 10-20-30. With error subfile C C C C C C C C C C ##RPNT ##RPNT ##RPNT ##F IFEQ 10 OREQ 20 OREQ 30 Z-ADD40 ##RPNT IFEQ 0 CALL 'IP060CLB'##PLES Z-ADD0 ##F END EXSR $D03 END Pointer 30 processing is the same as that for a fixed format. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 59 2.41 Subfile Format : Pointer 40. C C C* C C C C C C* C C C C C C* C C C C C C C C C C C C C C* C C C C C C* C C C C C* C C C* C C C C* C C* C C C C C C C* C ##RPNT ##RH03 ##ES03 ##PREV ##NEW ##OVRL ##INSL ##INSL IFEQ 40 Z-ADD50 IFEQ 0 MOVEL'0' ELSE MOVEL'1' END IFEQ 'N' MOVEL'0' ELSE MOVEL'1' END IFNE 03 MOVEL'0' MOVEL'0' MOVEL'0' ELSE MOVEL'1' MOVEL'1' MOVEL'1' IFEQ '0' MOVEL'1' MOVEL'0' END END IFEQ '0' MOVEL'0' ELSE MOVEL'1' END IFLT 1 ORGT 1 Z-ADD1 END WRITEM03CTL MOVEL'1' ##INSL ##RPNT *IN96 *IN96 *IN84 *IN84 *IN81 *IN82 *IN91 *IN81 *IN82 *IN91 ##NEW *IN81 *IN92 *IN92 ##INSL Messages *IN92 Error subfile Error subfile IFEQ 1 WRITES03IL1 END MOVEL'1' *IN92 Z-ADD03 EXFMTS03CTL MOVEL'0' MOVEL'0' MOVEL'0' MOVEL'0' ##PREV *IN81 *IN82 *IN91 *IN96 END Pointer 40 processing is the same as that for a fixed format, but 2 additional functions are executed : - set on or set off indicator 96 for SFLDSPCTL - set on or set off indicator 84 for SFLEND Manual IDDOS 13 RPG02 Interactive Program: Detail Description 60 2.42 Subfile Format : Pointer 50. Whithout UIM help C C C* C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C* C C C C C C C* C C C C C C C C C C C C C C C C C C C C C C C C C C C* C Manual IDDOS 13 ##RPNT *IN99 *INKY *IN99 *LOCK *INKY ##OVRL ##INSL ##INSL ##INSL ##RFDF IFEQ 50 Z-ADD60 ##RPNT DOWEQ'1' OREQ '1' IFEQ '1' MOVE ##LNNR ##ALF Z-ADD##BIN ##LINE MOVE ##PSNR ##ALF Z-ADD##BIN ##POS Z-ADD0 ##PREV OUT ##PARM CALL 'IP250RGB'##PLHT IN ##PARM MOVEL'0' *IN99 MOVEL'1' *IN91 END IFEQ '1' MOVEL'1' *IN91 IFEQ '0' MOVEL'0' *IN92 ELSE MOVEL'1' *IN92 END ADD 1 ##INSL IFLT 1 ORGT 1 Z-ADD1 ##INSL END IFEQ 1 WRITES03IL1 END END MOVEL'1' *IN92 WRITES03CTL READ S03CTL IFNE 0 Z-ADD##RFDF ##RS03 END END HELP CF24 89 MOVEL'0' *IN91 MOVEL'0' *IN92 Z-ADD0 ##LINE Z-ADD0 ##POS MOVEA##I *IN,1 CALL 'IP061CLB' *IN95 ##EF03 ##KL02 *IN87 ##RF02 *IN89 CUNMCU ##KL02 IFEQ '1' Z-ADD20 Z-ADD##RH03 IFEQ 'N' MOVEL##0103 SETLLMNCUMAR2 IFEQ '1' MOVEL'Y' ELSE DOUEQ##RL03 READ MNCUMAR2 IFEQ '1' MOVEL'Y' Z-ADD##RL03 ELSE IFNE ##0103 SETLLMNCUMAR2 Z-ADD##RL03 END END END END END ELSE EXSR $C03 END Error subfile Roll Up ##RPNT ##RN03 CUNM02 87 ##EF03 89 ##EF03 ##RF02 ##RF02 END RPG02 Interactive Program: Detail Description 61 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 is 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. − Rollup processing is available : − ##RHnn will be moved to ##RNnn − ##RPNT will be set to value 20 − the based-on file will be repositioned − the ##I table will overwrite the first 50 indicators in the program. − The program error messagequeue is cleared when using error subfile. − 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 Interactive Program: Detail Description 62 2.43 Subfile Format : Pointer 50. With UIM help C C C* C C C C C C C* C C C C C C C C C C C C C C C C C C C C C C C C C C C* C Manual IDDOS 13 ##RPNT IFEQ 50 Z-ADD60 ##RPNT MOVEL'0' *IN91 MOVEL'0' *IN92 Z-ADD0 ##LINE Z-ADD0 ##POS MOVEA##I *IN,1 CALL 'IP061CLB' *IN95 ##EF03 ##KL02 *IN87 ##RF02 *IN89 CUNMCU ##KL02 IFEQ '1' Z-ADD20 Z-ADD##RH03 IFEQ 'N' MOVEL##0103 SETLLMNCUMAR2 IFEQ '1' MOVEL'Y' ELSE DOUEQ##RL03 READ MNCUMAR2 IFEQ '1' MOVEL'Y' Z-ADD##RL03 ELSE IFNE ##0103 SETLLMNCUMAR2 Z-ADD##RL03 END END END END END ELSE EXSR $C03 END Error subfile Roll Up ##RPNT ##RN03 CUNM02 87 ##EF03 89 ##EF03 ##RF02 ##RF02 END RPG02 Interactive Program: Detail Description 63 Within pointer 50 processing : − ##RPNT will be set to value 60 − Command key 24 processing is available : If command key 24 is 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. − Rollup processing is available : − ##RHnn will be moved to ##RNnn − ##RPNT will be set to value 20 − the based-on file will be repositioned − the ##I table will overwrite the first 50 indicators in the program. − The program error messagequeue is cleared when using error subfile. − If you use UIM help, the help function is handled by OS/400, the display file and the panel group object. − 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 Interactive Program: Detail Description 64 2.44 Subfile Format : Pointer 60. C C C C ##RPNT IFEQ 60 Z-ADD61 EXSR $L03 END ##RPNT Within pointer 60 processing : − ##RPNT will be set to value 61 − the $Lnn routine will be executed. This routine must contain the code that is to be executed, before the READC routine is executed (e.g. locate). Manual IDDOS 13 RPG02 Interactive Program: Detail Description 65 2.45 Subfile Format : Pointer 61. C C C C C C C C C C C C C C C ##RPNT ##RH03 *IN80 ##RPNT IFEQ 61 Z-ADD62 IFNE 0 Z-ADD03 READCS03SFL DOWEQ'0' EXSR $X03 IFEQ 62 READCS03SFL ELSE MOVEL'1' END END END END ##RPNT ##TF99 80 80 *IN80 Within pointer 61 processing : − ##RPNT will be set to value 62 − the READC routine will handle all the records in the subfile, that have been modified by the user. This READC routine uses the process point $Xnn to process individual subfile records. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 66 2.46 Subfile Format : Pointer 62. C C C C C* C C C C* C C C C* C ##RPNT ##TF03 IFEQ 62 Z-ADD90 Z-ADD0 EXSR $P03 ##RPNT ##TF99 MOVEL'0' MOVEL'0' MOVEL'0' ##AD03 ##UP03 ##DL03 IFNE 0 Z-ADD##TF03 END ##TF99 END Pointer 62 processing is the same as that for a fixed format, but 'transfer' processing is also possible. The way this 'transfer' processing works is discussed later. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 67 2.47 Subfile Format : Pointer 90. C C C* C C C C C C C C C C C C* C ##RPNT ##TF99 IFEQ 90 Z-ADD99 IFNE 0 Z-ADD##TF99 Z-ADD0 Z-ADD61 ELSE MOVEL'0' Z-ADD##NSBR Z-ADD##NPNT Z-ADD01 Z-ADD01 END ##RPNT ##NSBR ##TF99 ##NPNT ##OVRL ##PSBR ##PPNT ##NSBR ##NPNT END Pointer 90 processing is the same as that for a fixed format. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 68 2.48 User Code : Pre-display. C*---------------------------------------------------------C*IDDOS: FRMT nn : Pre-display C*---------------------------------------------------------C $Vnn BEGSR C* C* --> generated pre-display access C* ************************************************************ *IDDOS: User code : Pre-display * ************************************************************ C* C $VnnZZ ENDSR The $Vnn routine will be generated for both a fixed and a subfile format. It consists of 2 elements : - the generated pre-display data base accesses - the user code written in the Vnn process point. This routine is executed in pointer 01 processing. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 69 2.49 User Code : Initialize subfile record. C*---------------------------------------------------------C*IDDOS: FRMT nn : Initialize subfile record C*---------------------------------------------------------C $Inn BEGSR C* *********************************************************** *IDDOS: User code : Subfile initialization * *********************************************************** C* C $InnZZ ENDSR The $Inn routine will be generated only for a subfile format. It contains the user code written in the Inn process point. This routine is executed in pointer 20 processing to load records into the subfile, which are not retrieved from the based-on file. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 70 2.50 User Code : Subfile record control. C*---------------------------------------------------------C*IDDOS: FRMT nn : Record Control C*---------------------------------------------------------C $Rnn BEGSR C* ************************************************************ *IDDOS: User code : Record control * ************************************************************ C* C $RnnZZ ENDSR The $Rnn routine will be generated only for a subfile format. It contains the user code written in the Rnn process point. This routine is executed in pointer 20 processing to control the ##NDSP field. This field determines whether or not a record retrieved from the based-on file, is loaded into the subfile. In this routine you can also determine when the subfile loading procedure has to stop (use *IM EOF or similar coding). Manual IDDOS 13 RPG02 Interactive Program: Detail Description 71 2.51 User Code : Additional Processing on Subfile Record. C*----------------------------------------------------------C*IDDOS: FRMT nn : Additional processing on subfile record C*----------------------------------------------------------C $Ann BEGSR C* ************************************************************ *IDDOS: User code : Additional processing on subfile record * ************************************************************ C* C $AnnZZ ENDSR The $Ann routine will be generated only for a subfile format. It contains the user code written in the $Ann process point. This routine is executed in pointer 20 processing for additional processing when loading records, from the based- on file, into the subfile. This migth include : − Modification of data − Adding related data from other data base files − Reset the subfile selection field (##OPTN) Manual IDDOS 13 RPG02 Interactive Program: Detail Description 72 2.52 User Code : Display navigation control. C*----------------------------------------------------------C*IDDOS: FRMT nn : Display C*----------------------------------------------------------C $Dnn BEGSR C* ************************************************************ *IDDOS: User code : Display * ************************************************************ C* C $DnnZZ ENDSR The $Dnn routine will be generated for each format in a program and can be used for detailed cursor navigation programming. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 73 2.53 User Code : Command-keys. C*---------------------------------------------------------C*IDDOS: FRMT nn : Cmd-keys C*---------------------------------------------------------C $Cnn BEGSR C* ************************************************************ *IDDOS: User code : Command-keys * ************************************************************ C* * --> generated code to process command keys C* C $CnnZZ ENDSR The $Cnn routine will be generated for both a fixed and a subfile format. It consists of 2 elements : - the user code written in the Cnn process point. - the generated code, based on the parameters entered on the 'command keys used on panel' screen This routine is executed in pointer 50 processing. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 74 2.54 User Code : Subfile general handling. C*---------------------------------------------------------C*IDDOS: FRMT nn : Subfile general handling C*---------------------------------------------------------C $Lnn BEGSR C* ************************************************************ *IDDOS: User Code : Subfile general handling * ************************************************************ C $LnnZZ ENDSR The $Lnn routine will be generated only for a subfile format. It contains the user code written in the Lnn process point. This routine is executed in pointer 60 processing to provide processing for a subfile control record. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 75 2.55 User Code : Subfile detail handling. C*---------------------------------------------------------C*IDDOS: FRMT nn : Subfile detail handling C*---------------------------------------------------------C $Xnn BEGSR C* ************************************************************ *IDDOS: User Code : Subfile detail handling * ************************************************************ C $XnnZZ ENDSR The $Xnn routine will be generated only for a subfile format. It contains the user code written in the Xnn process point. This routine is executed in pointer 61 processing to handle subfile records, retrieved within the READC cycle. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 76 2.56 User Code : Post-display. C*---------------------------------------------------------C*IDDOS: FRMT nn : Post-display C*---------------------------------------------------------C $Pnn BEGSR C* ************************************************************ *IDDOS: User code : Post-display ENTER-routine * ************************************************************ C* C $PnnZZ ENDSR The $Pnn routine will be generated for both a fixed and a subfile format. It consists of 2 elements : - the user code written in the Pnn process point. - the generated post-display data base accesses This routine is executed in pointer 62 processing. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 77 2.57 The Program Initialization routine. C*---------------------------------------------------------C*IDDOS: initialization C*---------------------------------------------------------C $I99 BEGSR C* C*----------------------------------------C* File 01 : MNCUMAL1 : Customer master by Customer Code C* C* C* Key-list fields C* C *LIKE DEFN CUCDCU CUCD01 C*----------------------------------------C* File 02 : MNCUMAL2 : Customer Master by Name C* C *LIKE DEFN CUACCU CUAC#2 C *LIKE DEFN CUADCU CUAD#2 C *LIKE DEFN CUCTCU CUCT#2 C *LIKE DEFN CUDTCU CUDT#2 C *LIKE DEFN CUZPCU CUZP#2 C* C* Key-list fields C* C *LIKE DEFN CUNMCU CUNM02 C* C* Key-list save-fields to control Roll-up C* C *LIKE DEFN CUNMCU ##0103 C*----------------------------------------C CALL 'IP061CLB' Clear error subfile C*----------------------------------------C* Fields IDDOS-parameter lists C* C Z-ADD0 ##ERNR 50 C* C MOVEL*BLANKS ##DDCD 10 C MOVEL*BLANKS ##CVAL 15 C MOVEL*BLANKS ##OMSC 30 C MOVEL*BLANKS ##DBVL 15 C MOVEL*BLANKS ##SWVR 1 C MOVEL*BLANKS ##FLDN 6 C* C MOVEL*BLANKS ##DATI 6 C MOVEL*BLANKS ##FMTI 1 C MOVEL*BLANKS ##FMTO 1 C MOVEL*BLANKS ##DATO 6 C MOVEL*BLANKS ##DATC 7 C* C MOVEL*BLANKS ##DTIC 10 C MOVEL*BLANKS ##DTOC 10 C MOVEL*BLANKS ##FMIC 7 C MOVEL*BLANKS ##FMOC 7 C* C MOVEL*BLANKS ##RETN 6 C MOVEL*BLANKS ##NAME 20 C* C MOVEL*BLANKS ##LYNR 20 C MOVEL*BLANKS ##FMAT 8 C*----------------------------------------C* IDDOS : Generator fields : general C* C MOVEA##MLTU *IN,61 C MOVEA*ALL'0' ##I C MOVE *LOVAL ##ALF C MOVEL*BLANKS ##EXIT 4 C MOVEL'Y' ##SWPR 1 C Z-ADD1 ##NSBR 20 C Z-ADD1 ##NPNT 20 C Z-ADD1 ##PSBR 20 C Z-ADD1 ##PPNT 20 C Z-ADD0 ##RPNT 20 C Z-ADD0 ##SC99 20 C MOVEL'LR' ##ENDP 2 C MOVEL'0' ##SWER 1 C MOVEL'0' ##OVRL 1 C MOVEL'1' ##NEW 1 C Z-ADD0 ##PREV 20 C Z-ADD0 ##F 50 C Z-ADD0 ##TF99 20 C Z-ADD0 ##RFSV 40 C Z-ADD1 ##INSL 10 C* C Z-ADD0 ##SFLL 40 Manual IDDOS 13 RPG02 Interactive Program: Detail Description 78 C MOVEL'N' ##NDSP C MOVEL*BLANKS ##SWES C*----------------------------------------C* IDDOS : Generator fields : format 01 C* C MOVEL'0' ##AD01 C MOVEL'0' ##UP01 C MOVEL'0' ##DL01 C*----------------------------------------C* IDDOS : Generator fields : format 02 C* C MOVEL'0' ##AD02 C MOVEL'0' ##UP02 C MOVEL'0' ##DL02 C Z-ADD6 ##WL02 C Z-ADD12 ##WP02 C Z-ADD0 ##WC02 1 1 1 1 1 1 1 1 Only if window Only if window 30 Only if window C*----------------------------------------C* IDDOS : Generator fields : format 03 C* C MOVEL'0' ##AD03 1 C MOVEL'0' ##UP03 1 C MOVEL'0' ##DL03 1 C Z-ADD0 ##TF03 20 C MOVEL'Y' ##ST03 1 SFL STOP C MOVEL'N' ##ES03 1 C MOVEL'N' ##EF03 1 C MOVEL'N' ##RA03 1 C Z-ADD0 ##RN03 40 C Z-ADD0 ##RH03 40 C Z-ADD0 ##RL03 100 C*----------------------------------------C* ************************************************************ *IDDOS: User code : Initial processing * ************************************************************ C* C $I99ZZ ENDSR Manual IDDOS 13 RPG02 Interactive Program: Detail Description 79 The Initialization routine performs the following functions : − Definition of the corresponding work fields for each file (*LIKE DEFN) that are not already defined in the display file of the program. − Definition of the key list fields for each file (*LIKE DEFN). − Definition of the fields (*LIKE DEFN), which are used to save the keys of the last record loaded into each subfile. − Definition of all the fields not already defined in the program, which are used in IDDOS parameter lists. − Definition of fields used in the generator. A first set of fields is available in each program. A second set of fields is only available for programs that contain at least 1 subfile. − Definition of fields necessary to process a format. For a subfile format, more fields are needed than for a fixed format. If a format will be presented in window some additional fields are generated. − User written initialization code in the INI process point. It is highly advisable to define each user field in the program in a data structure in the INP process point, or in the INI process point. If this advice is followed, only 2 process points need changing if field attributes need to be changed. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 80 2.58 The Program Error Handling routine. C*---------------------------------------------------------C*IDDOS: Error handling ! C*---------------------------------------------------------C *PSSR BEGSR C* C ##SWER IFEQ '1' C MOVEL'1' *INH1 C RETRN C ELSE C MOVEL'1' ##SWER C END C* C MOVEL##DSDF ##DSFL C* C ##PGFL IFEQ 'MNCUMAL1' C MOVEL##DS01 ##DSFL C END C* C ##PGFL IFEQ 'MNCUMAL2' C MOVEL##DS02 ##DSFL C END C* C OUT ##PARM C CALL 'IP099CLI'##PLER 98 C *LOCK IN ##PARM C* C U8 DUMP C MOVEL'0' ##SWER C ##RETN IFEQ '*CANCL' C MOVEL'1' *INLR C GOTO ##END C END C ENDSR##RETN Each IDDOS program uses the *PSSR routine to handle program errors. This routine uses the external program IP099CLI, which returns to the calling program with '*CANCL' in the ##RETN field to stop the program in error. However, when record locks are found, the program IP099CLI can return with blanks in the ##RETN field, and the calling program will be allowed to continue. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 81 2.59 User Written subroutines. C*---------------------------------------------------------C*IDDOS: User subroutines C*---------------------------------------------------------C* *********************************************************** *IDDOS: User code : User-subroutines * ************************************************************ If EXSR is used to execute subroutines from within user process points, these subroutines must be added to the program. They must be entered in the SBR process point. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 82 2.60 File Handling : Transfer file --> screen C $F01 BEGSR C* C*IDDOS: Transfer file --> screen C* C MOVELCUCDCU CUCD#1 C MOVELCUNMCU CUNM#1 C MOVELCUADCU CUAD#1 C MOVELCUZPCU CUZP#1 C MOVELCUCTCU CUCT#1 C MOVELCUACCU CUAC#1 C MOVELCUDTCU ##DATI C MOVEL'Y' ##FMTI C MOVEL'S' ##FMTO C EXSR $U99 C MOVEL##DATO CUDT#1 C*Date conversion with century support dates C MOVELDATECU ##DTIC C MOVEL'*ISO' ##FMIC C MOVEL'S ' ##FMOC C CALL 'IP032RGB'##PLCS C MOVEL##DTOC DATE#1 C* C $F01ZZ ENDSR P Century support P Century support P Century support Century support P Century support This routine is used to transfer the contents of the file fields to the corresponding program fields. It is generated for each file in the program, which has an input access defined, except for files only used in a filecheck. If date fields were used, date conversion through routine $U99 could be necessary. If date fields with century support are included, a call towards IP032RGB for date conversion is necessary. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 83 2.61 File Handling : Transfer screen --> file C $T01 BEGSR C* C*IDDOS: Transfer screen --> file C* C MOVELCUCD#1 CUCDCU C MOVELCUNM#1 CUNMCU C MOVELCUAD#1 CUADCU C MOVELCUZP#1 CUZPCU C MOVELCUCT#1 CUCTCU C MOVELCUAC#1 CUACCU C MOVELCUDT#1 ##DATI C MOVEL'S' ##FMTI C MOVEL'Y' ##FMTO C EXSR $U99 C MOVEL##DATO CUDTCU C*Date conversion with century support dates C MOVELDATE#1 ##DTIC C MOVEL'S ' ##FMIC C MOVEL'*ISO' ##FMOC C CALL 'IP032RGB'##PLCS C MOVEL##DTOC DATECU C* C $T01ZZ ENDSR P Century support P Century support P Century support Century support P Century support This routine is used to transfer the contents of the program fields to the corresponding file fields. It is generated for each file in the program, which has an update or output access defined, except for files only used in a filecheck. If date fields were used, date conversion through routine $U99 could be necessary. If date fields with century support are included, a call towards IP032RGB for date conversion is necessary. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 84 2.62 File Handling : Initialize non-key fields. C $B01 C* C*IDDOS: Init non-key C* C C C C C C C* C $B01ZZ BEGSR fields MOVEL*BLANKS MOVEL*BLANKS MOVEL*BLANKS MOVEL*BLANKS MOVEL*BLANKS Z-ADD*ZEROS CUNM#1 CUAD#1 CUZP#1 CUCT#1 CUAC#1 CUDT#1 ENDSR This routine is used to blank out the non-key fields in the program. It is generated for each file in the program, except for files only used in a filecheck. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 85 2.63 File Handling : Fill keylist. C $K01 C* C*IDDOS: Fill keylist C* C C* C $K01ZZ BEGSR from screen MOVELCUCD#1 CUCD01 ENDSR This routine is used to transfer the contents of the program fields to the corresponding key list fields. It is generated for each file in the program, for which a keyed access is defined, except for files only used in a filecheck. If date fields were used, date conversion through routine $U99 could be necessary. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 86 2.64 Date conversion routine. C C C C C C C C* C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C $U99 ##FMTI C C C C C C C C C C C C C C C C ##FMTO ##FMTI ##DATI ##DATI ##FMTI ##FMTO ##FMTO ##FMTO ##CYY ##FMTI ##FMTO ##FMTO C ##FMTO ##CYY ##FMTI ##FMTO Manual IDDOS 13 BEGSR IFEQ 'S' MOVE ##DTSV ENDIF IFEQ 'S' MOVE ##DTSV ENDIF IFEQ ##FMTO OREQ '000000' OREQ ' ' MOVE *ZEROS MOVE ##DATI ELSE IFEQ 'D' MOVE ##DATI IFEQ 'M' MOVE ##DDD MOVE ##DMM MOVE ##DYY MOVE ##MDAT ENDIF IFEQ 'Y' MOVE ##DDD MOVE ##DMM MOVE ##DYY MOVE ##YDAT ENDIF IFEQ 'C' MOVE ##DDD MOVE ##DMM MOVE ##DYY IFGE '40' MOVE '0' ELSE MOVE '1' ENDIF MOVE ##CDAT ENDIF ENDIF IFEQ 'M' MOVE ##DATI IFEQ 'D' MOVE ##MMM MOVE ##MDD MOVE ##MYY MOVE ##DDAT ENDIF IFEQ 'Y' MOVE ##MMM MOVE ##MDD MOVE ##MYY MOVE ##YDAT IFEQ 'C' MOVE ##MDD MOVE ##MMM MOVE ##MYY IFGE '40' MOVE '0' ELSE MOVE '1' ENDIF MOVE ##CDAT ENDIF ENDIF IFEQ 'Y' MOVE ##DATI IFEQ 'D' MOVE ##YYY ##FMTI ##FMTO ##DATC ##DATO ##DDAT ##MDD ##MMM ##MYY ##DATO ##YDD ##YMM ##YYY ##DATO ##CDD ##CMM ##CYY ##CCC ##CCC ##DATC ##MDAT ##DMM ##DDD ##DYY ##DATO ##YMM ##YDD ##YYY ##DATO ENDIF ##CDD ##CMM ##CYY ##CCC ##CCC ##DATC ##YDAT ##DYY RPG02 Interactive Program: Detail Description 87 C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C ##FMTO ##FMTO ##CYY ##FMTI ##FMTO ##FMTO ##FMTO $U99ZZ MOVE ##YMM MOVE ##YDD MOVE ##DDAT ENDIF IFEQ 'M' MOVE ##YYY MOVE ##YMM MOVE ##YDD MOVE ##MDAT ENDIF IFEQ 'C' MOVE ##YDD MOVE ##YMM MOVE ##YYY IFGE '40' MOVE '0' ELSE MOVE '1' ENDIF MOVE ##CDAT ENDIF ENDIF IFEQ 'C' MOVE ##DATI IFEQ 'D' MOVE ##CYY MOVE ##CMM MOVE ##CDD MOVE ##DDAT ENDIF IFEQ 'M' MOVE ##CYY MOVE ##CMM MOVE ##CDD MOVE ##MDAT ENDIF IFEQ 'Y' MOVE ##CMM MOVE ##CDD MOVE ##CYY MOVE ##YDAT ENDIF ENDIF ENDIF ENDSR ##DMM ##DDD ##DATO ##MYY ##MMM ##MDD ##DATO ##CDD ##CMM ##CYY ##CCC ##CCC ##DATC ##CDAT ##DYY ##DMM ##DDD ##DATO ##MYY ##MMM ##MDD ##DATO ##YMM ##YDD ##YYY ##DATO This routine is used to convert a date from one format to another. It is executed from IDDOS routines when appropriate, and can also be executed from within the user code. It only works for dates without century support. This routine performs the following functions : − if the date format is 'S', the correct date format is obtained from the ##DTSV field within the data area ##PARM. − the correct date conversion will be performed − the field ##DATO will contain the converted date. !!! no date checking is performed in the routine $U99 If you want to convert dates with century support use program IP032RGB. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 88 2.65 Program tables. *----------------------------------------------------------*IDDOS: Tables *----------------------------------------------------------* ************************************************************ *IDDOS: User code : Tables * This is the user process point to enter program table contents. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 89 2.66 Pre-display data base accesses. Pre-display data base accesses are always generated in the $Vnn routine. Generation of a data base access must be defined on the appropriate screen in the 'Files & Formats' function. Fig. 7 .................................................................................... Documentation system ID037RGI : : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM : Database accesses S01 : : : : Program . . . . . . . . : MN003RGI : : Routine . . . . . . . . : V02 : : : : Filenbr Access mode Release Filename Internal Keyroutine : : 1 I R MN02LF MN02LF *DEFAULT : : : : : : : : : : : : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - : : : : Filenbr Filename Internal Type Description : : 01 MN02LF MN02LF U Logical file MN02LF : : : : : : : : : : : : F3=Exit F12=Cancel : : : :..................................................................................: Manual IDDOS 13 RPG02 Interactive Program: Detail Description 90 This entry will result in the following code : C* C*IDDOS: C*IDDOS: C*IDDOS: C* C C C C C C C C C C C C C Generated data base access Access: Input File : MNCUMAL1 *IN88 ##KL01 *IN88 *IN87 EXSR $K01 DOUEQ'0' CHAINMNCUMAR IFEQ '1' EXSR *PSSR END END IFEQ '0' EXSR $F01 EXCPTREL01 ELSE EXSR $B01 END 8788 When the key routine was entered on the screen, an EXSR will be generated. Indicator 88 is used to capture errors on the input operation. If this error is a record lock, the *PSSR returns control to the next sequential instruction and the input operation can then be repeated. Indicator 87 is used to check for a successful completion of the input operation. If successful, the file fields will be moved to the corresponding program fields using the routine $Fff. If not, the corresponding non-keyed program fields will be blanked out using the routine $Bff. !!! ##KLff is used as the key list for this access. It is the responsibility of the programmer to provide the proper information in the key list if no key routine was entered on the screen (e.g. through the routine $Kff). If the key routine is *DEFAULT, EXSR $Kff will be generated. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 91 2.67 Post-display data base accesses. Post-display data base accesses are always generated in the $Pnn routine. Generation of a data base access must be defined on the appropriate screen in the 'Files & Formats' function. Fig. 8 .................................................................................... Documentation system ID037RGI : : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM : Database accesses S01 : : : : Program . . . . . . . . : MN003RGI : : Routine . . . . . . . . : P02 : : : : Filenbr Access mode Release Filename Internal Keyroutine : : 1 U A MN02LF MN02LF *DEFAULT : : : : : : : : : : : : - - - - - - - - - - - - - - - - - - - - - - - - - - - : : : : Filenbr Filename Internal Type Description : : 01 MN02LF MN02LF U Logical file MN02LF : : : : : : : : : : : : F3=Exit F12=Cancel : : : :..................................................................................: Manual IDDOS 13 RPG02 Interactive Program: Detail Description 92 This entry will result in the following code : C*IDDOS: C*IDDOS: C*IDDOS: C* C C C C C C C C C C C C C C C C C C C C Generated data base access Access: update add File : MNCUMAL1 *IN88 ##KL01 *IN88 *IN87 ##DL02 ##DL02 EXSR $K01 DOUEQ'0' CHAINMNCUMAR IFEQ '1' EXSR *PSSR END END IFEQ '0' IFEQ '1' DELETMNCUMAR ELSE EXSR $T01 UPDATMNCUMAR END ELSE IFNE '1' EXSR $T01 WRITEMNCUMAR END END 8788 When the key routine was entered on the screen, an EXSR will be generated. Indicator 88 is used to capture errors on the input operation. If this error is a record lock, the *PSSR returns control to the next sequential instruction and the input operation can then be repeated. Indicator 87 is used to check for a successful completion of the input operation. If successful, an update or a delete is issued depending upon the ##DLnn field, otherwise a write is issued. Corresponding program fields will be moved to the file fields using the $Tff routine. !!! ##KLff is used as the key list for this access. It is the responsibility of the programmer to provide the proper information in the key list if no key routine was entered on the screen (e.g. through the routine $Kff). If the key routine is *DEFAULT, EXSR $Kff will be generated. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 93 2.68 User Assist Code : checking values and ranges. A value or range check test can be generated for each field. This is derived from an attribute field where range or value validation was defined. Fig. 9 .................................................................................... Documentation system ID005RGI : : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM : Attribute base S021 : : : : : : Attribute field . . . . : ORDQ : : Description . . . . . . . Ordered quantity : : Column heading . . . . . Ordered : : Quantity : : : : : : Field length . . . . . . 9 : : : Type . . . . . . . . . . P : Decimals . . . . . . . . 0 : : : : FRF fieldname . . . . . . ORDQ : : FRF name . . . . . . . . ##FRF + : : : : : + : : Language . : Copy . . . + : : : : F3=Exit F4=Prompt F5=Validation F7=Keywords F12=Cancel : : F14=Description F18=Edit text F19=View text F20=Print text : : : :..................................................................................: Manual IDDOS 13 RPG02 Interactive Program: Detail Description 94 The following code will be generated : C*Check values/ranges for CUAC#1 C MOVEL*BLANKS ##DDCD C MOVEL'CUAC' ##DDCD C MOVEL*BLANKS ##CVAL C MOVELCUAC#1 ##CVAL C OUT ##PARM C CALL 'IP020RGB'##PLVR C *LOCK IN ##PARM C ##SWVR IFEQ 'N' C MOVEL'1' *IN06 C Z-ADD999 ##F C CALL 'IP060CLB'##PLES C Z-ADD0 ##F C Z-ADD30 ##RPNT C GOTO $P02ZZ C END Error subfile Error subfile C*Check values/ranges for CUAC#1 Generated comment line C C MOVEL*BLANKS MOVEL'CUAC' ##DDCD ##DDCD The attribute name of the field to be controlled must be placed in the ##DDCD parameter field. C C MOVEL*BLANKS MOVELCUAC#1 ##CVAL ##CVAL The contents of the screen field must be placed in the ##CVAL parameter field. C C C *LOCK OUT ##PARM CALL 'IP020RGB'##PLVR IN ##PARM The program IP020RGB is called to perform the value or range check. C ##SWVR IFEQ 'N' The program IP020RGB returns a control value of 'Y' if a correct value or range was found 'N' if an incorrect value or range was found Manual IDDOS 13 RPG02 Interactive Program: Detail Description 95 C C C C C C C MOVEL'1' *IN06 Z-ADD999 ##F CALL 'IP060CLB'##PLES Z-ADD0 ##F Z-ADD30 ##RPNT GOTO $P02ZZ END Error subfile Error subfile The error number 999 is used for value checks. The error number 998 is used for range checks. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 96 2.69 User Assist Code : filecheck. A filecheck can be generated for each field. This derived from an attribute field where range, value or filecheck validation was defined. Fig. 10 .................................................................................... : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID005RGI : : Attribute base S022 : : : : : : Attribute field . . . . : ORDQ : : : Validation . . . . . . . F : Date format . . . . . . . + : + : : Edit code . . . . . . . . : : Edit word . . . . . . . . : REFSHIFT . . . . . . . . + : : CCSID . . . . . . . . . . + : : : DFT numeric . . . . . . . : DFT alfanumeric . . . . . : : : : : : : : : : : : Language . + : : Copy . . . + : : : : F3=Exit F4=Prompt F5=Validation F7=Keywords F12=Cancel : : F14=Description F18=Edit text F19=View text F20=Print text : : : :..................................................................................: Manual IDDOS 13 RPG02 Interactive Program: Detail Description 97 The following code will be generated : C*IDDOS: C*IDDOS: C*IDDOS: C* C C C C C C C C C C C C Generated database check Field : CUZP#1 File : WSZIPCL1 C*IDDOS: C*IDDOS: C*IDDOS: C* Generated database check Field : CUZP#1 File : WSZIPCL1 ##KL01 *IN87 ##F MOVELCUZP#1 CUZP01 CHAINWSZIPCR IFEQ '1' MOVEL'1' *IN03 IFEQ 0 Z-ADD00995 ##F CALL 'IP060CLB'##PLES Z-ADD0 ##F END Z-ADD30 ##RPNT GOTO $P02ZZ END 87 Error subfile Error subfile Generated comment line C MOVELCUZP#1 CUZP01 Fill up the key field. C C C C C C C C C C C ##KL01 *IN87 ##F CHAINWSZIPCR IFEQ '1' MOVEL'1' *IN03 IFEQ 0 Z-ADD00995 ##F CALL 'IP060CLB'##PLES Z-ADD0 ##F END Z-ADD30 ##RPNT GOTO $P02ZZ END 87 Error subfile Error subfile Read the file. If the read fails then the error indicator is set, the error number is filled in and a goto is performed to the end of the routine. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 98 2.70 User Assist Code : checking validity of dates. A date validity check test can be generated for each field. This is derived from an attribute field where a 'format date' selection was defined. Fig. 11 .................................................................................... Documentation system ID005RGI : : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM : Attribute base S022 : : : : : : Attribute field . . . . : BIDT : : Validation . . . . . . . : : : Date format . . . . . . . *YMD + : Edit code . . . . . . . . Y + : : Edit word . . . . . . . . : : REFSHIFT . . . . . . . . + : : CCSID . . . . . . . . . . + : : : DFT numeric . . . . . . . : DFT alfanumeric . . . . . : : : : : : : : : : : : Language . + : : Copy . . . + : : : : F3=Exit F4=Prompt F5=Validation F7=Keywords F12=Cancel : : F14=Description F18=Edit text F19=View text F20=Print text : : : :..................................................................................: The following code will be generated : C*Check date for CUDT#1 C MOVELCUDT#1 ##DATI C MOVEL'S' ##FMTI C MOVEL'Y' ##FMTO C MOVEL*BLANKS ##DATO C OUT ##PARM C CALL 'IP030RGB'##PLDT C *LOCK IN ##PARM C ##DATO IFEQ '999999' C MOVEL'1' *IN05 C Z-ADD997 ##F C CALL 'IP060CLB'##PLES C Z-ADD0 ##F C Z-ADD30 ##RPNT C GOTO $P02ZZ C END Error subfile Error subfile C*Check date for CUDT#1 Manual IDDOS 13 RPG02 Interactive Program: Detail Description 99 Generated comment line C MOVELCUDT#1 ##DATI The date on screen must be placed in the ##DATI parameter field. C MOVEL'S' ##FMTI The format of the date on screen must be placed in the ##FMTI field. C MOVEL'Y' ##FMTO The format of the date in data base must be placed in the ##FMTO field. C MOVEL*BLANKS ##DATO The ##FMTO must be blanked out. C C C *LOCK OUT ##PARM CALL 'IP030RGB'##PLDT IN ##PARM The program IP030RGB is called to perform the date check. C ##DATO IFEQ '999999' The program IP030RGB returns the reformatted date in the ##FMTO field. If an incorrect date was found, '999999' will be returned in the ##FMTO field. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 100 C C C C C C C MOVEL'1' *IN.. Z-ADD997 ##F CALL 'IP060CLB'##PLES Z-ADD0 ##F Z-ADD30 ##RPNT GOTO $P02ZZ END Error subfile Error subfile The error number 997 is used for the date validity check. This date checking procedure only works for dates without century support. If you have attributes of datatype L following code can be used to check dates with century support. C*Check date for DATE#1 C MOVELDATE#1 ##DTIC C MOVEL'*ISO' ##FMIC C MOVEL'S ' ##FMOC C MOVEL*BLANKS ##DTOC C CALL 'IP031RGB'##PLCS C ##DATO P P P IFEQ '999999' The program IP031RGB returns the reformatted date in the ##DTOC field. If an incorrect date was found, '999999' will be returned in the ##DTOC field. C C C C C C C Manual IDDOS 13 MOVEL'1' *IN.. Z-ADD997 ##F CALL 'IP060CLB'##PLES Z-ADD0 ##F Z-ADD30 ##RPNT GOTO $P02ZZ END Error subfile Error subfile RPG02 Interactive Program: Detail Description 101 2.71 Command key processing. The HELP and ROLLUP key are automatically supported. Other command keys can be entered on the appropriate screen in the 'Files & Formats' function. Fig. 12 .................................................................................... : INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID028RGI : : Command lines S01 : : : : Display file . . . . . . : MN003RGD : : Format . . . . . . . . . : S02FMT : : : : Cmdkey Text A/U/D Program Plist Pre-sbr Post-sbr Format Pointer : : CF03 Exit 99 : : CF04 *PROMPT : : CF12 Cancel 1 1 : : : : : : : : : : : : : : : : : : : : : : + : : : : F3=Exit F12=Cancel : : : :..................................................................................: This entry will result in the following code : C* .... .......... C *IN.. C C C C *LOCK C C C C C C C C C C* .... .......... IFEQ '1' EXSR ...... OUT ##PARM CALL '........'...... IN ##PARM MOVEL'.' ##AD.. MOVEL'.' ##UP.. MOVEL'.' ##DL.. MOVEL'0' ##OVRL Z-ADD.. ##NSBR Z-ADD.. ##NPNT Z-ADD99 ##RPNT EXSR ...... END On the first line, the text entered for the command key, is generated as a comment statement. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 102 *IN.. IFEQ '1' On this line, .. will be replaced by the relevant command key indication. (KA, KB,..) C EXSR ...... An EXSR of the pre-subroutine is generated. This routine can be used to fill the parameter list of the program to be called. C C C *LOCK OUT ##PARM CALL '........'...... IN ##PARM The call of the program to be called when the command key is pressed, is generated, together with its parameter list. Data area IDPARM is updated before the call and is retrieved again afterwards. C C C MOVEL'.' MOVEL'.' MOVEL'.' ##AD.. ##UP.. ##DL.. The add, update and delete codes are set to '0'. If 'A' was entered on the A/U/D field on the screen, then ##ADnn is set to '1'. If 'U' was entered on the A/U/D field on the screen, then ##UPnn is set to '1'. If 'D' was entered on the A/U/D field on the screen, then ##DLnn is set to '1'. C C C C Manual IDDOS 13 MOVEL'0' Z-ADD.. Z-ADD.. Z-ADD99 ##OVRL ##NSBR ##NPNT ##RPNT RPG02 Interactive Program: Detail Description 103 Field ##OVRL is used to determine if overlay is active or not. Fields ##NSBR and ##NPNT are used to determine the next routing point to be addressed. The ##RPNT will be set to 99 if the processing of the current format must be stopped. C EXSR ...... An EXSR of the post-subroutine is generated. This routine can be used to alter the previously defined routing, if the results of the called program indicate that this is necessary. C END Following special 'Text' entries are possible : A special 'Text' entry is *PROMPT. If that 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 ('#'-field or 'H'-field), IDDOS will call IP039RGI to select a value. Format and pointer must be both blank. In the pre subroutine, the field ##SWPR (switch prompt) can be set to 'N'. Then the *PROMPT function will not be executed (e.g. when the field is actualy protect). In the post subroutine, the value of the field ##OMSC (description) can be moved to a work field on the panel. A special 'Text' entry is *HELP, this command key will function for alternate HELP in the display file. A special 'Text' entry is *SFLDROP, this command key will function with the subfile drop keyword in the display file. A special 'Text' entry is *FOLDDROP, this command key will function with the subfile drop/subfile fold keyword in the display file. A special 'Text' entry is *ROLLUP, this command key will function for rollup in subfile formats. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 104 A special 'Text' entry is *ROLLDWN, this command key will function for rolldown in subfile formats. A special 'Text' entry is *MORE, this command key will be used to show multiple lines of command keys. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 105 2.72 Displaying errors on the screen. To display errors on the screen, the following code can be used: C C C C C C C C ..........test........... MOVEL'1' *IN.. Z-ADD... ##F CALL 'IP060CLB' Z-ADD0 ##F Z-ADD30 ##RPNT GOTO $P..ZZ END Error subfile Error subfile If a test indicates an error situation, the following actions should be taken : − an indicator (01-50) should be set on to indicate the field in error (RI and PC can be used with this indicator). − the error number to be displayed must be placed in the ##F field. − the ##RPNT must be set to 30 to redisplay the format with the error indicator on. − When using error subfiles, the error has to be sent to the program error messagequeue. − a GOTO $PnnZZ must be coded to display errors one by one on the screen. IDDOS will retrieve the text from the error message, redisplay the screen with the error indicator on, and afterwards, initialize indicators 01 through 50. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 106 2.73 Handling more than one error on a screen. If errors must be displayed on the screen, they can be displayed one by one at each redisplay, or simultaneously. If simultaneous display is required, the following code must be provided : C C C C C C C C C C* C C C C C C C C C C*... C C C C C C C C C C* C C C ..........test 1 ........ MOVEL'1' *IN.. ##F IFEQ 0 Z-ADD... ##F CALL 'IP060CLB' Z-ADD0 ##F Z-ADD30 ##RPNT END END ..........test 2 ........ MOVEL'1' *IN.. ##F IFEQ 0 Z-ADD... ##F CALL 'IP060CLB' Z-ADD0 ##F Z-ADD30 ##RPNT END END ..........test 3 ........ MOVEL'1' *IN.. ##F IFEQ 0 Z-ADD... ##F CALL 'IP060CLB' Z-ADD0 ##F Z-ADD30 ##RPNT END END ##RPNT Error subfile Error subfile Error subfile Error subfile Error subfile Error subfile IFEQ 30 GOTO $P..ZZ END The ##F field is used to find out if any errors were found after a set of tests. The tests must be done in the order the fields appear on the screen. All the fields in error will be indicated, but the error message will be the message for the first field on the screen. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 107 2.74 Handling a group of records to load a subfile. If only a limited group of records must be placed in a subfile, the READE instruction is available in RPG. To do this, a partial key list must also be available. IDDOS offers another technique to achieve this. In the $Vnn routine, the starting value for the load of the subfile can be set in the keylist. In the $Rnn routine, code can be included to stop the processing of the based-on file. C C C C C C C ...if record no longer in the group .... MOVEL'Y' ##NDSP MOVEL'Y' ##EFnn ##STnn IFEQ 'Y' MOVEL'Y' ##ESnn END END Field ##NDSP must be set to 'Y' to indicate that the current record must not be loaded to the subfile. Field ##EFnn must be set to 'Y' to indicate that reading of the based-on file must be stopped. Field ##ESnn must be set to 'Y' to indicate that no blank records must be loaded to the subfile, if the ##STnn was on (= 'Y'). If blank records must be loaded to the subfile, ##STnn must be set to off (= 'N') and ##ESnn will not be set to 'N'. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 108 2.75 The ##TF99 field. IDDOS has a special way of dealing with multiple selections in a subfile. Before the READC cycle is started, the current format number is stored in the ##TF99 field. The program can then give control to another format. When this format has been completely handled, pointer 90 will be processed. If a transfer control was made by IDDOS, ##TF99 contains the number of the subfile format that control was transferred from. Control will be returned to that format, pointer 61, to retrieve the next record in the subfile. This can be observed in detail in the example program in this chapter. !!! If 'exit' is taken from a format, to which control was transferred from a subfile (e.g. CF12 on screen 2 in our example program), this ##TF99 field must be initialized again to avoid a transfer of control to the subfile, the first time that pointer 90 is executed again. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 109 2.76 Calling another program. IDDOS uses a data area IDPARM to communicate between your programs, or to communicate with programs in the Execution Environment. Each program, generated by IDDOS, retrieves this data area when the program starts. The data area will be locked. When the program ends, this data area is updated by the program and unlocked. If a program must be called, this data area must be unlocked with the OUT statement. If control is returned to the calling program, the new contents of the data area IDPARM must be retrieved through the IN statement. As locking and unlocking the data area IDPARM is a required action, this data area can be used to exchange information between programs. To achieve this, 256 bytes of information are available in the ##UPRM field. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 110 2.77 Program indicators. In IDDOS interactive programs, indicators must be used, according to the following rules : 01 --> 59 : to be used in IDDOS programs 01 --> 50 : errors on screen (RI PC) 51 --> 59 : additional display file functions 60 : reserved for future use 61 --> 66 : for control language dependency 67 --> 78 : reserved for future use 79 : Switch mode/alternate-mode (future use) 80 : READC indicator 81 : OVRDTA for output fields 82 : OVRDTA for both fields 83 : switch protect - non-protect (future use) 84 : SFLEND 85 : reserved for future use 86 : SHTDN (shutdown) (future use) 87 : condition HI (pos 62.63) -READ -COMPARE -SETLL -... 88 : condition LO (pos 64.65) "" 89 : condition EQ (pos 66.67) "" 90 : SFLNXTCHG 91 : PUTOVR 92 : OVERLAY PROTECT 93 : error on READ for display file/ALARM in display file 95 : Rollup 96 : SFLDSP 97 : SFLCLR 98 : error on call (*PSSR) 99 : HELP Manual IDDOS 13 RPG02 Interactive Program: Detail Description 111 2.78 Program routines. The names of subroutines in IDDOS interactive programs are built using the following conventions : − position 1 = $ − position 2 = A-Z − position 3-4 = 0-9 − position 5-6 = ZZ (for ENDSR; the first 4 positions have to be the first 4 positions of the BEGSR name) Each routine has a different function. The routines found in interactive programs are : $Ann Routine, including extra detail instructions to be executed when a record, which has been retrieved from the based-on file, must be written to the subfile. --> each subfile format $Bff Routine, used to blank the non-key program fields for the file with number ff. --> each data base file, used in the program and not only used for a filecheck. $Cnn Post-display command key processing. --> each format in the program $Dnn Display navigation routine. --> each format in the program $Fff Routine, used to transfer file field contents to the corresponding program fields. --> each data base file, if used for input in the program and not only used for a filecheck. $I99 General initialization routine (at program start) --> program level routine $Inn Routine containing extra detail instructions for blank subfile records. --> each subfile format $Kff Routine, used to transfer program fields to the corresponding key list fields. --> each data base file, if keyed access is used in the program and not only used for a filecheck. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 112 $Lnn Routine, used at ENTER time, on the subfile control format nn, for any processing required before processing the READC on the subfile, e.g. to handle 'locate',... --> each subfile format $Pnn Routine, used for the ENTER processing of format nn. The processing in the user process point Pnn is executed, followed by the generated post-display data base accesses. --> each format in the program $Rnn Routine containing record control processing, deciding if a record from the based-on file must be loaded into the subfile. --> each subfile format $Snn main driver routine for a format. --> each format in the program $Tff Routine, used to transfer program field contents to the corresponding file fields. --> each data base file, if used for update in the program and not only used for a filecheck. $U99 Routine, used for date conversion. --> only if dates have to be converted in the program. $Vnn Routine, used for pre-display processing of format nn. Pre-generated data base accesses are executed, followed by the user code in process point Vnn. --> each format in the program Manual IDDOS 13 RPG02 Interactive Program: Detail Description 113 2.79 Program fields. The interactive generator uses a set of predefined program fields. When adding your own program fields, you must make sure you avoid conflicts. Program fields, derived from file fields, are built according to the following rules : − For each file in the program, a set of fields is used, derived from the file fields. To build these fields, the move-part of the field name is concatenated with '#f', where 'f' stands for the number of the file in the program (1-9,A-Z). − For each keyed file in the program, a KLIST is defined by the generator. To build the fields in this keylist, the move-part of the field name is concatenated with 'ff', where 'ff' stands for the number of the file in the program (01-35). Furthermore, a set of program fields is used to execute particular functions. These program fields start with the characters '##'. !!! Because future extensions to the generator will add program fields to this list, no user-defined program-fields should have '##' as starting characters. The functions of these program fields are described below : − ##ADnn A(1) Add-status for format nn. This is used to make 'add' the default data base access when data base accesses are generated. '0' : the add-status is OFF '1' : the add-status is ON Manual IDDOS 13 RPG02 Interactive Program: Detail Description 114 − ##ALF A(2) Normally, a binary field needs 2 or 4 bytes to store the information. This rule was not respected in the File Information Data Structure (binary fields of 1 byte were used). To access the information contained in these fields, a conversion routine must be executed. ##ALF is part of the intermediate data structure used by this routine. − ##ALFA A(15) ##ALFA is part of a data structure to convert packed fields to alfanumeric fields in a range check. − ##BIN B(4,0) Part of the intermediate data structure used to convert 1-byte binary fields. − ##CMDC A(2) This field is an element from the data structure ##PARM. The last pressed command key can be placed in this field, to make this information available to the calling program. In future releases, a routine can be expected to fill this field automatically. In that case, the following rules will be followed: 'KA' = F01, 'KB' = F02,... , 'RU' = Roll-up, 'RD' = Roll-down, 'EN' = Enter, ... − ##CSFL A(10) Used in the display with RTNCSRLOC keyword, contains the field name. − ##CSPS P(4,0) Used in the display with RTNCSRLOC keyword, contains the position in the field. − ##CSRC A(10) Used in the display with RTNCSRLOC keyword, contains the record name. − ##CSRR P(5,0) Used in the display with SFLCSRRRN keyword, contains the subfile relative record number. − ##CVAL A(15). This field is an element of the parameter list for the Execution Environment program IP020RGB, which is used to check the entered value on the screen against a value list or a field range. ##CVAL must contain the value to be checked. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 115 − ##DATI A(6) This field is an element of the parameter list for the Execution Environment program IP030RGB, which is used to check the validity of the date, entered on the screen. ##DATI must contain the date to be checked. − ##DATO A(6) This field is an element of the parameter list for the Execution Environment program IP030RGB, which is used to check the validity of the date, entered on the screen. ##DATO will contain the checked date in the format, determined by the ##FMTO parameter. − ##DBVL A(15) This field is an element of the parameter listfor the execution environment program IP020RGB, which is used to check the entered value on the screen against a value list or a field range. This field is intended for future use. − ##DDAT DS(6) This field is the data structure name of one of the data structures, which is used in the routine $U99 to reformat dates on screen. The ##DDAT data structure will contain the dates in DMY format. − ##DDCD A(10). This field is an element of the parameter list for the Execution Environment program IP020RGB, which is used to check the entered value on the screen against a value list or a field range. ##DDCD must contain the name of the attribute base field for which the value tables or ranges were defined. − ##DDD A(2) This field is a part of the data structure ##DDAT, which is used in the routine $U99 to reformat dates on screen. The ##DDD field will contain the day part of the dates in DMY format. − ##DLnn A(1) Delete-status for format nn. This is used to make 'delete' the default data base access when data base accesses are generated !!! Every update access will be changed to delete. '0' : the delete-status is OFF '1' : the delete-status is ON Manual IDDOS 13 RPG02 Interactive Program: Detail Description 116 − ##DMM A(2) This field is a part of the data structure ##DDAT, which is used in the routine $U99 to reformat dates on screen. The ##DMM field will contain the month part of the dates in DMY format. − ##DSDF DS(400) The name of the File Information Data Structure used for the display file. − ##DSff DS(400) The name of the File Information Data Structure used for the data base file with number ff. − ##DTIC A(10) This field is used in the parameter lists for date checking and conversion with century support (IP031RGB and IP032RGB). − ##DTOC A(10) This field is used in the parameter lists for date checking and conversion with century support (IP031RGB and IP032RGB). − ##DTSV A(1) This field is an element from the data structure ##PARM. If the value 'S' was used for the 'date format on panel' status, the system value QDATFMT will decide the date format on panels. If QDATFMT = 'DMY', ##DTSV = 'D' If QDATFMT = 'MDY', ##DTSV = 'M' If QDATFMT = 'YMD', ##DTSV = 'Y' The routine $U99 uses this value to reformat the date on screen. − ##DYY A(2) This field is a part of the data structure ##DDAT, which is used in the routine $U99 to reformat dates on screen. The ##DYY field will contain the year part of the dates in DMY format. − ##EFnn A(1) The end-of-file status for the based-on file when when subfile number nn is being loaded. 'N' = *default 'Y' = Manual IDDOS 13 the based-on file has reached end-of-file. The value 'Y' is automatically assigned by the program when end-of-file is reached. The programmer can also change this field to 'Y' to stop the loading of records from the based-on file. RPG02 Interactive Program: Detail Description 117 − ##ENDP A(2) End-of-program status. This field decides how to stop the program. The field is assigned an initial value when the program is started. --> 'LR' for a '*PERM' program exit. --> 'RT' for a '*TEMP' program exit. --> ' ' for a '*USER' program exit. − ##ERNR P(3,0) This field is an element of the parameter list for the Execution Environment program IP050RGB, which is used to bring up the HELP-facilities. This field contains the number of the error-message, issued by the program. If HELP was pressed on the message line (line 24), the second-level screen for the message will be shown. − ##ESnn A(1) The end-of-subfile status for subfile nn. 'N' = *default 'Y' = the subfile nn has reached the end-of-subfile situation. No further records will be placed in the subfile. The value 'Y' is automatically assigned by the program when the based-on file has reached end-of-file, AND the status of field ##STnn is on, to stop the loading of the subfile. The programmer can also change this field to 'Y' to stop the loading of further records into the subfile. − ##EXIT A(4) This field can be used to force the program main driver to be executed more than once. The value 'EXIT' is provided automatically to stop the program after execution of the program main driver. This value has to be changed to *BLANKS in the END process point to provide another execution of the program main driver. − ##F P(3,0) This field contains the error number for the message to be shown on the panel. This field must be filled through user process code. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 118 − ##FLNM A(8) This field is an element of the parameter list for the Execution Environment program IP050RGB, which is used to bring up the ELP-facilities. This field contains the name of the display file in the program. This field is also found as an element of the data structure ##DSDF, the file information data structure for the splay file. If HELP was pressed, the field ##FLNM is a utomatically passed to the HELP circuit. − ##FMAT A(8) This field is used in the parameterlist ##PLFS to pass the name of the screen to the IDDOS program. − ##FMIC A(7) This field is used in the parameter lists for date checking and conversion with century support (IP031RGB and IP032RGB). − ##FMOC A(7) This field is used in the parameter lists for date checking and conversion with century support (IP031RGB and IP032RGB). − ##FMTI A(1) This field is an element of the parameter list for the Execution Environment program IP030RGB, which is used to check the validity if the date, entered on the screen. ##FMTI must contain the format of the date, found in ##DATI. − ##FMTO A(1) This field is an element of the parameter list for the Execution Environment program IP030RGB, which is used to check the validity if the date, entered on the screen. ##FMTO must contain the format of the date, found in ##DATO. − ##FRMT A(8) This field is an element of the parameter list for the Execution Environment program IP050RGB, which is used to bring up the HELP-facilities. This field contains the name of the display file in the program. This field is also found as an element of the data structure #DSDF, the file information data structure for the display file. HELP waspressed, the field ##FLNM is automatically passed to the HELP circuit. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 119 − ##FSDF Z(5,0) This field is an element of the data structure ##DSDF, the file information data structure for the display file. ##FSDF will contain the *STATUS code for file accesses to the display file. − ##FSff Z(5,0) This field is an element of the data structure ##FSff, the file information data structure for the data base file with number ff in the program. ##FSff will contain the *STATUS code for file accesses on the data base file with number ff. − ##I(50) A(1) This is an array to contain the settings of the first 50 program-indicators. Initially, this array is filled with *ALL'0'. This array will be used to overwrite the contents of the program indicators after each EXFMT. − ##INSL P(1,0) This field is used to define which instruction format must be sent. The possible values for this field are 1, 2, 3 and 4, depending upon the number of available instruction formats for each panel to display. If ##INSL = 1, format SnnIL1 will be sent. If ##INSL = 2, format SnnIL2 will be sent. If ##INSL = 3, format SnnIL3 will be sent. If ##INSL = 4, format SnnIL4 will be sent. IF ##INSL contains any other value, format SnnIL1 will be sent. − ##KLff KLIST This is the key-list name for the file with number ff. − ##LINE P(3,0) This field contains the line position of the cursor in the CRSLOC keyword in the display file. − ##LNNR A(1) This field is an element from the file information data structure of the display file. It contains the line position of the cursor. (1 byte binary information). This field must be converted to numeric using the ##ALF and ##BIN fields. − ##LYNR P(2,0) This field is used in the parameterlist ##PLFS to get the first line number of a subfile on the screen when using the *PROMPT generated by IDDOS. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 120 − ##MDAT DS(6) This field is one of the data structures, used in the routine $U99 to reformat dates on screen. The ##MDAT data structure will contain the dates in MDY format. − ##MDD A(2) This field is a part of the data structure ##MDAT, used in the routine $U99 to reformat dates on screen. The ##MDD field will contain the day part of the dates in MDY format. − ##MESS A(78) This field is an element of the parameter list for the Execution Environment program IP010RGB, which is used to retrieve the message descriptions. This field name is also used for the instruction formats, which removes the need for move statements. − ##MLTU A(6) This field is an element of the data structure ##PARM. It contains the language code of the user. − ##MMM A(2) This field is a part of the data structure ##MDAT, used in the routine $U99 to reformat dates on screen. The ##MMM field will contain the month part of the dates in MDY format. − ##MYY A(2) This field is a part of the data structure ##MDAT, used in the routine $U99 to reformat dates on screen. The ##MMM field will contain the year part of the dates in MDY format. − ##NDSP A(1) This field is used to decide whether or not to add a record from the based-on file to the subfile. 'N' : the non-display status is OFF and the record will be loaded to the subfile 'Y' : the non-display status is ON and the record will not be loaded to the subfile. Initially, this value will be set OFF. The programmer must decide, in the Rnn routine, if a record from the based-on file must be loaded to the subfile. If not, the value must be set to ON in the user code. This value will be automatically reset to off before the next execution of the Rnn routine. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 121 − ##NEW A(1) This field is used to decide if the OVRDTA keyword for output fields must be active (indicator 81 on). 'N' : OVRDTA not in effect. Output fields on the screen remain unchanged. 'Y' : OVRDTA in effect. Changes in output fields on the screen will be displayed. Initially, this value will be set to 'Y'. In that case, output fields will be redisplayed. If this is not wanted, the programmer must assign, in the user process code, a value 'N' to this field. The next EXFMT will not redisplay output fields. This EXFMT however, will reset the value to 'Y'. − ##NPNT P(2,0) This field is used to determine the starting point in the format handling routine. − ##NSBR P(2,0) This field is used in the main program driver. It holds the format number of the format to be handled. − ##OMSC A(30) This field is an element of the parameter list for the Execution Environment program IP020RGB, which is used to check the entered value on the screen against a value list or a field range. ##OMSC brings the description of the value item back to the program. − ##OPTN A(1) Option field to enter subfile selections. Available for each program, containing a subfile. − ##OVRL A(1) Overlay status. 'N' = no overlay 'Y' = EXFMT with overlay In end-of-format processing (pointer 90), IDDOS decides if the ##OVRL status must be made effective. ##OVRL is set to 'Y' if the current format is specified as the format number to be kept in overlay when the format, specified in the ##NSBR field is sent. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 122 − ##PACK P(15,9) ##PACK is part of a data structure to convert packed fields to alfanumeric fields in a range check. − ##PARM DS(1024) The data structure to define the compositional elements for the data area IDPARM. − ##PGDS DS(429) The data structure to define the compositional elements for the program status data structure. − ##PGFL A(8) This field is an element of the data structure ##PGDS, which is used as the program status data structure. The ##PGFL field contains the name of the last data base file, accessed by the program. − ##PGLB A(10) This field is an element of the data structure ##PGDS, which is used as the program status data structure. The ##PGLB field contains the library name, where the program in execution is stored. − ##PGNM A(10) This field is an element of the data structure ##PGDS, which is used as the program status data structure. The ##PGNM field contains the name of the program in execution. − ##PGPM Z(3,0) This field is an element of the data structure ##PGDS, which is used as the program status data structure. The ##PGPM field contains the number of parameters, passed to the program. − ##PGST Z(5,0) This field is an element of the data structure ##PGDS, which is used as the program status data structure. The ##PGST field contains the program (error) status. − ##PGUS A(10) This field is an element of the data structure ##PGDS, which is used as the program status data structure. The ##PGUS field contains the name of the user executing the program. − ##PLCS PLIST Parameterlist for date checking and conversion with century support (IP031RGB and IP032RGB). Manual IDDOS 13 RPG02 Interactive Program: Detail Description 123 − ##PLDT PLIST This field is the parameter list name for the Execution Environment program IP030RGB, which is used to check date validity. − ##PLER PLIST This field is the parameter list name for the Execution Environment program IP099CLI, which is used as the error-handling program. − ##PLHT PLIST This field is the parameter list name for the Execution Environment program IP250RGB, which is used to bring up the HELP-facilities. − ##PLMS PLIST This field is the parameter list name for the Execution Environment program IP010RGB, which is used to retrieve the error message text. − ##PLVR PLIST This field is the parameter list name for the Execution Environment program IP020RGB, which is used to check values and ranges. − ##POS P(3,0) This field contains the column position of the cursor in the CRSLOC keyword in the display file. − ##PPNT P(2,0) This field contains the previously used pointer number. − ##PREV P(2,0) This field contains the number of the previously displayed panel format. This field will be used to control the PUTOVR/OVRDTA situation. − ##PSBR P(2,0) This field contains the previously used format number. − ##PSNR A(1) This field is an element from the file information data structure of the display file. It contains the column position of the cursor. (1 byte binary information). This field must be converted to numeric using the ##ALF and ##BIN fields. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 124 − ##RAnn A(1) This field will indicate whether the pointer in the file must be repositioned (record not available) or not (record available) before loading a new page in the subfile after ROLLUP was pressed. 'N' = record is not available 'Y' = record is available necessary when the based on file of the subfile is a join logical file − ##RETN A(6) This field is an element of the parameter list for the Execution Environment program IP099CLI, which is used to handle program-errors. This field returns the value '*CANCL' or blanks to the calling program. − ##RFDF B(4,0) This field is an element of the data structure ##DSDF, the file information data structure for the display file. ##RFDF will contain the subfile record number for the last accessed subfile. − ##RFSV P(4,0) Field used by IDDOS to save the subfile record number of the last accessed subfile. − ##RFff B(9,0) This field is an element of the data structure ##DSff, the file information data structure for data base file ff. ##RFff will contain the last accessed relative record number for file ff. − ##RHnn P(4,0) This field contains the highest subfile record number, loaded into subfile number nn. − ##RLnn P(10,0) This field is contains the relative record number of the last loaded record in the based-on file for subfile format nn. − ##RNnn P(4,0) The field used in the KSFILE extension to contain the record number for subfile format nn. − ##RPNT P(2,0) This field controls the format handling. This field is used to drive the format handling routine by executing the processing points one by one. If changes to this default process must be made, it must be done by changing the ##RPNT value. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 125 − ##RSnn P(4,0) This field is used for the SFLRCDNBR keyword for subfile format nn. − ##SCnn P(2,0) Field used to control the display of a particular format when using multiple screen fixed formats. − ##SC99 P(2,0) Field used to control the display of a particular format when using multiple screen fixed formats. − ##SFLL P(4,0) Subfile loading status − ##SFnn P(2,0) Subfile Size − ##SMnn P(2,0) Subfile Multiplier − ##STnn A(1) Subfile loading stop status 'Y' = the subfile will contain only records from the based-on file. Loading of the subfile will be stopped when the based-on file reaches end-of-file. 'N' = when the based-on file reaches end-of-file, blank records will be added to the subfile. − ##SWES A(1) Switch used by IDDOS to control end of subfile indication. Can be used for other purposes by the developer. − ##SWPR A(1) This field will determine whether the *PROMPT function will be executed or not. 'N' = *PROMPT function will not be executed 'Y' = *PROMPT function will be executed The value of the field ##SWPR can only be set to 'N' in user code. IDDOS will automatically reset this to 'Y', the default value. − ##SWVR A(1) This field is an element of the parameter list for the Execution Environment program IP020RGB, which is used to check the entered value on the screen against a value list or a field range. ##SWVR is returned to the calling program. 'N' = incorrect value or range 'Y' = correct value or range − ##TFnn P(2,0) Transfer flag for subfile nn Manual IDDOS 13 RPG02 Interactive Program: Detail Description 126 − ##TF99 P(2,0) General transfer flag. Used to control multiple subfile select processing Manual IDDOS 13 RPG02 Interactive Program: Detail Description 127 − ##TLCD A(1) This field is an element of the data structure ##PARM. It contains the language code of the application system. − ##TLCU A(1) This field is an element of the data structure ##PARM. It contains the language code of the user. − ##UPRM A(256) This field is an element of the data structure ##PARM. It contains the user parameter list. This parameter list can be used or inter program communication. − ##UPnn A(1) Update-status for format nn. This is used to make 'update' the default data base access when data base accesses are generated '0' : the update-status is OFF '1' : the update-status is ON − ##WCnn P(3,0) Field used by IDDOS to control help function and IDDOS generated prompting in window formats when the help function isn't implemented through UIM. − ##WLnn P(2,0) Field containing the start line number for a windowed format. This field is initialised in the $I99 routine and can be modified in user coding. − ##WPnn P(3,0) Field containing the start position number for a windowed format. This field is initialised in the $I99 routine and can be modified in user coding. − ##YDAT DS(6) This field is the data structure name of one of the data structures, used in the routine $U99 to reformat dates on screen. The ##YDAT data structure will contain the dates in YMD format. − ##YDD A(2) This field is a part of the data structure ##YDAT, used in the routine $U99 to reformat dates on screen. The ##YDD field will contain the day part of the dates in YMD format. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 128 − ##YMM A(2) This field is a part of the data structure ##YDAT, used in the routine $U99 to reformat dates on screen. The ##YMM field will contain the month part of the dates in YMD format. − ##YYY A(2) This field is a part of the data structure ##YDAT, used in the routine $U99 to reformat dates on screen. The ##YYY field will contain the year part of the dates in YMD format. − ##XXnn Field to save the contents of key-field number XX for the last loaded record in the based-on file for subfile format nn. Manual IDDOS 13 RPG02 Interactive Program: Detail Description 129