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

TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

TABLE OF CONTENTS

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

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

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

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

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

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

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

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

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

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

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

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

Page 2: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

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

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

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

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

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

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

Page 3: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 1 Interactive Program: Detail Description

RPG02: Interactive Program : Detail Description.

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

Page 4: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 2 Interactive Program: Detail Description

2.1 The example program : Description.

Program MN001RGI : Customer Maintenance.

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

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

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

Files to be used in the program:

Customer Master by Customer Code: Update/Add

Customer Master by Name : Input (for selection)

Page 5: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 3 Interactive Program: Detail Description

Screen 1 : Key Prompt.

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

01 MANUAL IDDOS MN001RGI S01FMT 00/00/00

02 00:00:00

03

04

05 Customer Code: BBBBB

06

07

08

09

10

11

12

13

14

15

16

17

18

19

20

21

22

23 F04=Selection F03=Exit F12=Cancel

24 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

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

Pre-display : Initialize customer code

F03 : Exit Program

F04 : Selection (to screen 3, page 1)

F12 : Exit Program

Enter : Test : Customer Code Required Proceed to screen 2

Page 6: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 4 Interactive Program: Detail Description

Screen 2 : Detail Maintenance screen.

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

01 MANUAL IDDOS MN001RGI S02FMT 00/00/00

02 00:00:00

03

04

05 Customer Code: OOOOO

06

07

08 Customer Name: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

09

10 Customer Address: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

11

12 Customer Zip Code: BBBBBBBB

13

14 Customer City: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

15

16

17 Customer Date: 999999

18

19

20 Customer Activity Code: B OOOOOOOOOOOOOOOOOOOOOOOOOOO

21

22

23 F11=Delete F03=Exit F12=Cancel

24 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

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

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

F03 : Exit Program

F04 : Prompt (if field has a value table)

F11 : Delete customer

F12 : Back to screen 1 (no update)

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

Proceed to screen 1

Page 7: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 5 Interactive Program: Detail Description

Screen 3 : Selection Screen.

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

01 MANUAL IDDOS MN001RGI S03SFL 00/00/00

02 00:00:00

03 Type Options, press Enter

04 1=Select

05

06 Opt Name Code

07 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

08 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

09 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

10 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

11 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

12 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

13 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

14 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

15 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

16 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

17 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

18 B OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOO

19

20

21

22

23 F03=Exit F12=Cancel

24 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

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

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

F03 : Exit Program

F12 : Back to screen 1

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

Page 8: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 6 Interactive Program: Detail Description

2.2 The Example program : Technical Analysis.

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

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

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

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

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

Page 9: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 7 Interactive Program: Detail Description

2.3 The Example program : Display File.

Some elements used to build the display file source, are

− display file header

− REF keyword, referencing to the pseudo reference file.

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

− PUTOVER and OVERLAY/PROTECT for each format

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

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

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

− SFLCSRRRN keyword with ##CSRR for subfile relative record number

− KEEP keyword

− For each format, the command keys to be used

− H-specs if UIM help function is used

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

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

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

− WINDOW keywords if the format will be presented in window.

− SFLNXTCHG for each subfile format

− SFLDSP/SFLDSPCTL/SFLCLR keyword for each subfile control format

Page 10: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 8 Interactive Program: Detail Description

− SFLPAG keyword for each subfile control format

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

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

Page 11: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 9 Interactive Program: Detail Description

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

* *

* Description : Customer Maintenance *

* *

* Author : RVA *

* *

* Creation date : 20.05.99 *

* *

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

* GENERATED BY THE PROGRAM GENERATOR *

* *

* IIIII DDDD DDDD OOOO SSSSS *

* I D D D D O O S *

* I D D D D O O SSSSS *

* I D D D D O O S *

* IIIII DDDD DDDD OOOO SSSSS *

* *

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

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

The following information is contained in the program header:

Description :

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

Page 12: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 10 Interactive Program: Detail Description

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

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

: Programs S02 :

: :

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

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

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

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

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

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

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

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

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

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

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

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

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

: :

: :

: :

: Language . + :

: Copy . . . + :

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

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

: :

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

Author :

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

Creation Date :

Date of generation of the program.

Page 13: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 11 Interactive Program: Detail Description

2.5 The H-specification.

H 1 /J

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

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

Page 14: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 12 Interactive Program: Detail Description

2.6 The Display File.

FMN001RGDCF E WORKSTN KINFDS ##DSDF

F KINFSR *PSSR

F ##RN03KSFILE S03SFL

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

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

Fig. 2

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

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

: INTERACTIVE program design S03 :

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

: Customer Maintenance :

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

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

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

: Add format number . . . . . 00 :

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

: :

: Type options, press Enter. :

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

: 9=Synonyms D=Description P=PPU :

: Opt Format Next format Pointer :

: S01FMT 01 01 :

: :

: :

: :

: :

: :

: EINDE :

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

: :

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

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

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

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

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

Page 15: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 13 Interactive Program: Detail Description

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

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

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

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

Page 16: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 14 Interactive Program: Detail Description

2.7 Files used in the program.

FMNCUMAL1UF E K DISK A

F KINFDS ##DS01

F KINFSR *PSSR

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

Fig. 3

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

: INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID018RGI :

: INTERACTIVE program design S01 :

: :

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

: :

: Type options, press Enter. :

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

: 7=DB-access 8=Based on :

: Opt Nr Filename Internal Text Use :

: 01 MN02LF MN02LF Logical file MN02LF U K A:

: 02 MN01PF MN01PF Physical file MN01PF U :

: :

: :

: :

: :

: :

: :

: :

: :

: :

: :

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

: F10=Files F12=Cancel :

: :

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

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

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

Page 17: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 15 Interactive Program: Detail Description

Fig. 4

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

: INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID020RGI :

: INTERACTIVE program design S01 :

: :

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

: :

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

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

: Internal name . . . . . . MN01PF :

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

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

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

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

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

: User controlled . . . . . N :

: Commitment control . . . . N :

: :

: :

: :

: :

: Generation INFSR Y :

: :

: :

: F3=Exit F4=Prompt F12=Cancel :

: :

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

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

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

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

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

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

Page 18: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 16 Interactive Program: Detail Description

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

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

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

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

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

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

Fig. 5

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

: INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID118RGI :

: Records in program S01 :

: :

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

: renamed as : :

: in program : MN003RGI :

: :

: Ignore Number Record format Renamed Record format :

: Y/N :

: N 01 MN02LFR :

: :

: :

: :

: :

: :

: :

: :

: :

: :

: F12=Cancel :

: :

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

Page 19: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 17 Interactive Program: Detail Description

2.8 Initial indicator Table.

E ##I 50 1

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

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

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

Page 20: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 18 Interactive Program: Detail Description

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

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

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

*

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

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

Page 21: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 19 Interactive Program: Detail Description

2.10 The Program Status Data Structure.

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

I*IDDOS: Program Status Data Structure

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

I##PGDS SDS 429

I 1 10 ##PGNM

I 81 90 ##PGLB

I 91 170 ##DATA

I 201 208 ##PGFL

I 209 2130##STCD

I 244 253 ##JBNM

I 254 263 ##PGUS

I 264 2690##JBNR

I 358 367 ##CUUS

I *PARMS ##PGPM

I *STATUS ##PGST

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

The following details are available :

- ##PGNM : the program name

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

- ##DATA : the message data.

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

- ##STCD : the status code.

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

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

running

- ##CUUS : the current user

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

- ##PGST : the program status code

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

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

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

- use the defined fields to capture the information.

Page 22: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 20 Interactive Program: Detail Description

2.11 Display file : File Information Data Structure

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

I*IDDOS: File Information Data Structure

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

I##DSDF DS 400

I 1 8 ##FLNM

I 38 45 ##FRMT

I 370 370 ##LNNR

I 371 371 ##PSNR

I B 378 379 ##RFDF

I *STATUS ##FSDF

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

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

- ##FRMT : the current record format name

- ##LNNR : cursor position : line number

- ##PSNR : cursor position : colomn number

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

- ##FSDF : File status code

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

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

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

− use the defined fields to capture the information.

Page 23: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 21 Interactive Program: Detail Description

2.12 Data base files : File Information Data Structure

I##DS01 DS 400

I 38 45 ##FM01

I 46 52 ##CP01

I B 397 4000##RF01

I *STATUS ##FS01

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

The following information is available :

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

− ##CPff : the error message ID for this file

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

− ##FSff : the file status

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

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

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

− use the defined fields to capture the information.

Page 24: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 22 Interactive Program: Detail Description

2.13 IDPARM : IDDOS Parameter Data Structure.

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

I*IDDOS: Parameter Data Structure

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

I##PARM DS 1024

I 1 10 ##KLID

I 176 176 ##TLCD

I 177 177 ##TLCU

I 178 179 ##CMDC

I 337 337 ##DTSV

I 368 373 ##MLTU

I 7691024 ##UPRM

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

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

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

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

- ##KLID : the system name

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

- ##TLCU: the language code of the user

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

Page 25: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 23 Interactive Program: Detail Description

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

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

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

Page 26: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 24 Interactive Program: Detail Description

2.14 Cursor position Conversion Data Structure.

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

I*IDDOS: Cursor position Conversion Data Structure

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

I DS

I 1 2 ##ALF

I B 1 20##BIN

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

I DS

I 1 15 ##ALFA

I P 1 159##PACK

This data structure is used for range testing.

Page 27: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 25 Interactive Program: Detail Description

2.15 Date Conversion Data Structures.

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

I*IDDOS: Date Conversion Data Structures

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

I##DDAT DS

I 1 2 ##DDD

I 3 4 ##DMM

I 5 6 ##DYY

I##MDAT DS

I 1 2 ##MMM

I 3 4 ##MDD

I 5 6 ##MYY

I##YDAT DS

I 1 2 ##YYY

I 3 4 ##YMM

I 5 6 ##YDD

I##CDAT DS

I 1 1 ##CCC

I 2 3 ##CYY

I 4 5 ##CMM

I 6 7 ##CDD

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

- ##DDAT for a date in the DMY format

- ##MDAT for a date in the MDY format

- ##YDAT for a date in the YMD format

- ##CDAT for a date in the CYMD format

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

Page 28: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 26 Interactive Program: Detail Description

2.16 Keylist Section.

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

C*IDDOS: Keylist Section

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

C ##KL01 KLIST

C KFLD CUCD01

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

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

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

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

Page 29: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 27 Interactive Program: Detail Description

2.17 (Entry) Parameter list.

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

C*IDDOS: Parameter list Section

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

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

*IDDOS: User Code : (Entry) Parameter lists

*

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

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

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

- the program may need a *ENTRY parameter list

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

Page 30: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 28 Interactive Program: Detail Description

2.18 Default Parameter lists in the program.

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

C*IDDOS: Parameter list for HELP circuit

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

C ##PLHT PLIST

C PARM ##PGNM

C PARM ##FLNM

C PARM ##FRMT

C PARM ##LNNR

C PARM ##PSNR

C PARM ##ERNR

C PARM ##CSFL

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

C*IDDOS: Parameter list for control field values

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

C ##PLVR PLIST

C PARM ##DDCD

C PARM ##CVAL

C PARM ##OMSC

C PARM ##DBVL

C PARM ##SWVR

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

C*IDDOS: Parameter list for date conversion

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

C ##PLDT PLIST

C PARM ##DATI

C PARM ##FMTI

C PARM ##FMTO

C PARM ##DATO

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

C*IDDOS: Parameter list for messages

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

C ##PLMS PLIST

C PARM ##PGNM

C PARM ##ERNR

C PARM ##MESS

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

C*IDDOS: Parameter list for error-handling

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

C ##PLER PLIST

C PARM ##DSDF

C PARM ##PGDS

C PARM ##RETN

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

C*IDDOS: Parameterlist for list request

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

C ##PLVA PLIST

C PARM ##PGNM

C PARM ##DSPF

C PARM ##CSRC

C PARM ##CSFL

C PARM ##CVAL

C PARM ##OMSC

C PARM ##DBVL

C PARM ##FLDN

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

C*IDDOS: Parameterlist for first subfile line

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

C ##PLFS PLIST

C PARM ##FLNM

C PARM ##KLID

C PARM ##FMAT

C PARM ##FLDN

C PARM ##LYNR

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

C*IDDOS: Parameterlist for error subfile

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

C ##PLES PLIST

C PARM ##F

C PARM ##TLCU

C PARM ##PGNM

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

C*IDDOS: Parameterlist for date conversion (century)

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

C ##PLCS PLIST

C PARM ##DTIC

C PARM ##DTOC

C PARM ##FMFC

C PARM ##FMOC

C PARM ##DTSV

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

Page 31: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 29 Interactive Program: Detail Description

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

THE HELP CIRCUIT (if no UIM is used).

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

- ##PGNM : the program name

- ##FLNM : the name of the display file

- ##FRMT : the format name

- ##LNNR : the line number

- ##PSNR : the column number

- ##ERNR : the last used error number

- ##CSFL : the field name

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

CHECKING VALUES AND RANGES.

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

- ##DDCD : the attribute field name

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

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

- ##DBVL : reserved for future use

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

Page 32: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 30 Interactive Program: Detail Description

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

DATE VALIDITY CHECK.

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

- ##DATI : the date to be tested

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

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

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

The program IP030RGB can be used to

- perform a validity check on a date

- reformat the date

RETRIEVE THE ERROR MESSAGE TO BE DISPLAYED.

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

- ##PGNM : the program name

- ##ERNR : the error number

- ##MESS : the error message text

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

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

- ##F : the error number to be displayed

- ##TLCU : the language code

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

Page 33: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 31 Interactive Program: Detail Description

ERROR HANDLING.

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

- ##DSDF : the File Information Data Structure

- ##PGDS : the Program Status Data Structure

- ##RETN : the return value

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

DATE CONVERSION.

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

- ##DTIC : the input date

- ##DTOC : the output date

- ##FMIC : the input date format

- ##FMOC : the output date format

- ##DTSV : system value QDATFMT

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

Page 34: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 32 Interactive Program: Detail Description

RETRIEVE A VALUE BY PROMPT FUNCTION.

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

- ##PGNM : the program name

- ##DSPF : the name of the display file

- ##CSRC : the format name

- ##CSFL : the field name

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

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

- ##DBVL : reserved for future use

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

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

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

Page 35: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 33 Interactive Program: Detail Description

2.19 Main routine : Retrieve the data area IDPARM

C *NAMVAR DEFN IDPARM ##PARM

C *LOCK IN ##PARM Ext. parms

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

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

Page 36: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 34 Interactive Program: Detail Description

2.20 Main routine : Executing the Initialization routine

C EXSR $I99 Initialize

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

Page 37: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 35 Interactive Program: Detail Description

2.21 Main routine : CASE routine driver.

C ##NSBR DOWNE99

C*

C ##NSBR CASEQ01 $S01

C ##NSBR CASEQ02 $S02

C ##NSBR CASEQ03 $S03

C END

C*

C END

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

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

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

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

Fig. 6

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

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

: INTERACTIVE program design S03 :

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

: Customer Maintenance :

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

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

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

: Add format number . . . . . 00 :

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

: :

: Type options, press Enter. :

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

: 9=Synonyms D=Description P=PPU :

: Opt Format Next format Pointer :

: S01FMT 01 01 :

: :

: :

: :

: :

: :

: :

: EINDE :

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

: :

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

Page 38: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 36 Interactive Program: Detail Description

2.22 Main routine : Super-level program drivers.

C ##EXIT DOWEQ*BLANKS

*

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

*IDDOS: User Code : Driver routine

*

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

*---> CASE routine driver

*

C MOVEL'EXIT' ##EXIT

*

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

*IDDOS: User Code : End program Conditioning

*

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

*

C END

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

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

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

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

Page 39: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 37 Interactive Program: Detail Description

2.23 Main routine : The ##END TAG.

C ##END TAG

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

Like most rules, there is the occasional exception.

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

Page 40: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 38 Interactive Program: Detail Description

2.24 Main routine : Write Data Area IDPARM

C OUT ##PARM

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

Page 41: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 39 Interactive Program: Detail Description

2.25 Main routine : Ending the Program.

C ##ENDP IFEQ 'LR'

C MOVEL'1' *INLR

C END

C ##ENDP IFEQ 'RT'

C RETRN

C END

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

Page 42: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 40 Interactive Program: Detail Description

2.26 Fixed format : The Format driver.

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

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

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

C $S01 BEGSR

C*

C Z-ADD##NPNT ##RPNT

C*

C ##RPNT DOWNE99

C*

C ##RPNT IFEQ 1

*--> Process action point 01

C END

C*

C ##RPNT IFEQ 10

C ##RPNT OREQ 20

C ##RPNT OREQ 30

*--> Process action point 30

C END

C*

C ##RPNT IFEQ 40

*--> Process action point 40

C END

C*

C ##RPNT IFEQ 50

*--> Process action point 50

C END

C*

C ##RPNT IFEQ 60

C ##RPNT OREQ 61

C ##RPNT OREQ 62

*--> Process action point 62

C END

C*

C ##RPNT IFEQ 90

*--> Process action point 90

C END

C*

C END

C*

C $S01ZZ ENDSR

Page 43: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 41 Interactive Program: Detail Description

A format is processed according to the following citeria :

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

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

The following process points are available for a fixed format :

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

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

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

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

- pointer 40 : Displaying the format.

- pointer 50 : Processing the command keys

--> Help (whithout UIM)

--> Command key 24

--> Command key(s) *PROMPT function

--> user process point Cnn

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

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

- pointer 62 : User process point Pnn

- pointer 90 : End-format processing

Page 44: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 42 Interactive Program: Detail Description

2.27 Fixed Format : Pointer 01.

C ##RPNT IFEQ 1

C Z-ADD10 ##RPNT

C Z-ADD0 ##INSL

C EXSR $V01 Pre-Display

C END

Within Pointer 01 processing :

− ##RPNT will be set to value 10

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

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

Page 45: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 43 Interactive Program: Detail Description

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

C ##RPNT IFEQ 10

C ##RPNT OREQ 20

C ##RPNT OREQ 30

C Z-ADD40 ##RPNT

C Z-ADD##F ##ERNR

C ##F IFEQ 0

C MOVEL*BLANKS ##MESS

C ELSE

C OUT ##PARM

C CALL 'IP010RGB'##PLMS

C *LOCK IN ##PARM

C Z-ADD0 ##F

C END

C EXSR $D01

C END

Within Pointer 30 processing :

− ##RPNT will be set to value 40

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

Page 46: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 44 Interactive Program: Detail Description

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

C ##RPNT IFEQ 10

C ##RPNT OREQ 20

C ##RPNT OREQ 30

C Z-ADD40 ##RPNT

C ##F IFEQ 0

C CALL 'IP060CLB'##PLES

C Z-ADD0 ##F

C END

C EXSR $D01

C END

Within Pointer 30 processing :

− ##RPNT will be set to value 40

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

Page 47: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 45 Interactive Program: Detail Description

2.30 Fixed Format : Pointer 40.

C ##RPNT IFEQ 40

C Z-ADD50 ##RPNT

C*

C ##PREV IFNE 01 No Redisplay

C MOVEL'0' *IN81

C MOVEL'0' *IN82

C MOVEL'0' *IN91

C ELSE Same screen

C MOVEL'1' *IN81

C MOVEL'1' *IN82

C MOVEL'1' *IN91

C ##NEW IFEQ '0'

C MOVEL'1' ##NEW

C MOVEL'0' *IN81

C END

C END

C*

C ##OVRL IFEQ '0'

C MOVEL'0' *IN92

C ELSE

C MOVEL'1' *IN92

C END

C*

C ##INSL IFLT 1

C ##INSL ORGT 1

C Z-ADD1 ##INSL

C END Messages

C*

C WRITEM99CTL Error subfile

C MOVEL'1' *IN92 Error subfile

C*

C ##INSL IFEQ 1

C WRITES01IL1

C END

C*

C MOVEL'1' *IN92

C Z-ADD01 ##PREV

C EXFMTS01FMT

C MOVEL'0' *IN81 Reset 1

C MOVEL'0' *IN82

C MOVEL'0' *IN91

C*

C END

Page 48: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 46 Interactive Program: Detail Description

Within pointer 40 processing :

− ##RPNT will be set to value 50

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

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

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

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

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

Page 49: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 47 Interactive Program: Detail Description

2.31 Fixed Format : Pointer 50. Whithout UIM help

C ##RPNT IFEQ 50

C Z-ADD60 ##RPNT

C*

C *IN99 DOWEQ'1' HELP

C *INKY OREQ '1' CF24

C *INKD OREQ '1' *PROMPT

C *IN99 IFEQ '1'

C *INKD OREQ '1'

C MOVE ##LNNR ##ALF

C Z-ADD##BIN ##LINE

C MOVE ##PSNR ##ALF

C Z-ADD##BIN ##POS

C Z-ADD0 ##PREV

C END

C *IN99 IFEQ '1'

C OUT ##PARM

C CALL 'IP250RGB'##PLHT

C *LOCK IN ##PARM

C MOVEL'0' *IN99

C MOVEL'1' *IN91

C END

C *INKY IFEQ '1'

C MOVEL'1' *IN91

C ##OVRL IFEQ '0'

C MOVEL'0' *IN92

C ELSE

C MOVEL'1' *IN92

C END

C ADD 1 ##INSL

C ##INSL IFLT 1

C ##INSL ORGT 1

C Z-ADD1 ##INSL

C END

C ##INSL IFEQ 1

C WRITES01IL1

C END

C END

C *INKD IFEQ '1'

C EXSR PR0104

C ##SWPR IFEQ 'Y'

C OUT ##PARM

C CALL 'IP039RGI'##PLVA

C *LOCK IN ##PARM

C ##FLDN IFEQ *BLANKS

C Z-ADD30 ##RPNT

C Z-ADD996 ##F

C END

C ##FLDN IFNE '*NONE '

C ##FLDN IFEQ 'ACCD#1'

C MOVEL##CVAL ACCD#1

C END

C ##FLDN IFEQ 'COCD#1'

C MOVEL##CVAL COCD#1

C END

C END

C ELSE

C MOVEL'Y' ##SWPR

C END

C *INKD IFEQ '1'

C EXSR PS0104

C END

C MOVEL'1' *IN91

C MOVEL'1' *IN82

C MOVEL'1' *IN81

C*

C Z-ADD##F ##ERNR

C ##F IFEQ 0

C MOVEL*BLANKS ##MESS

C ELSE

C OUT ##PARM

C CALL 'IP010RGB'##PLMS

C *LOCK IN ##PARM

C Z-ADD0 ##F

C END

C ##OVRL IFEQ '0'

C MOVEL'0' *IN92

C ELSE

C MOVEL'1' *IN92

Page 50: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 48 Interactive Program: Detail Description

C END

C ##INSL IFEQ 1

C WRITES01IL1

C END

C END

C*

C MOVEL'1' *IN92

C WRITES01FMT

C READ S01FMT 89

C END

C*

C*

C MOVEL'0' *IN91 Reset 2

C MOVEL'0' *IN92

C Z-ADD0 ##LINE

C Z-ADD0 ##POS

C MOVEA##I *IN,1

C CALL 'IP061CLB' Error subfile

C*

C EXSR $C01 Cmd-keys

C*

C END

Within pointer 50 processing :

− ##RPNT will be set to value 60

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

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

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

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

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

Page 51: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 49 Interactive Program: Detail Description

2.32 Fixed Format : Pointer 50. With UIM help

C ##RPNT IFEQ 50

C Z-ADD60 ##RPNT

C*

C MOVEL'0' *IN91 Reset 2

C MOVEL'0' *IN92

C Z-ADD0 ##LINE

C Z-ADD0 ##POS

C MOVEA##I *IN,1

C CALL 'IP061CLB' Error subfile

C*

C EXSR $C01 Cmd-keys

C*

C END

Within pointer 50 processing :

− ##RPNT will be set to value 60

− The program error messagequeue will be cleared.

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

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

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

Page 52: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 50 Interactive Program: Detail Description

2.33 Fixed Format : Pointer 60-61-62.

C ##RPNT IFEQ 60

C ##RPNT OREQ 61

C ##RPNT OREQ 62

C Z-ADD90 ##RPNT

C EXSR $P01 Post-Display

C*

C MOVEL'0' ##AD01

C MOVEL'0' ##UP01

C MOVEL'0' ##DL01

C END

Within pointer 62 processing :

− ##RPNT will be set to value 90

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

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

Page 53: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 51 Interactive Program: Detail Description

2.34 Fixed Format : Pointer 90.

C ##RPNT IFEQ 90

C Z-ADD99 ##RPNT

C*

C ##TF99 IFNE 0

C Z-ADD##TF99 ##NSBR

C Z-ADD0 ##TF99

C Z-ADD61 ##NPNT

C ELSE

C MOVEL'0' ##OVRL

C Z-ADD##NSBR ##PSBR

C Z-ADD##NPNT ##PPNT

C Z-ADD02 ##NSBR

C Z-ADD01 ##NPNT

C END

C*

C END

Within pointer 90 processing :

− ##RPNT will be set to value 99

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

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

Page 54: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 52 Interactive Program: Detail Description

2.35 Subfile Format: The Format driver.

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

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

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

C $S03 BEGSR

C*

C Z-ADD##NPNT ##RPNT

C*

C ##RPNT DOWNE99

C*

C ##RPNT IFEQ 1

*--> Process action point 01

C END

C*

C ##RPNT IFEQ 10

*--> Process action point 10

C END

C*

C ##RPNT IFEQ 20

*--> Process action point 20

C END

C*

C ##RPNT IFEQ 30

*--> Process action point 30

C END

C*

C ##RPNT IFEQ 40

*--> Process action point 40

C END

C*

C ##RPNT IFEQ 50

*--> Process action point 50

C END

C*

C ##RPNT IFEQ 60

*--> Process action point 60

C END

C*

C ##RPNT IFEQ 61

*--> Process action point 61

C END

C*

C ##RPNT OREQ 62

*--> Process action point 62

C END

C*

C ##RPNT IFEQ 90

*--> Process action point 90

C END

C*

C END

C*

C $S03ZZ ENDSR

Page 55: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 53 Interactive Program: Detail Description

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

The following process points are available for a subfile format :

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

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

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

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

- pointer 40 : Displaying the format.

- pointer 50 : Processing the command keys

--> Help (Whithout UIM)

--> Command key 24

--> Roll up

--> user process point Cnn

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

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

- pointer 62 : user process point Pnn

- pointer 90 : end-format proccessing

Page 56: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 54 Interactive Program: Detail Description

2.36 Subfile Format : Pointer 01.

C ##RPNT IFEQ 1

C Z-ADD10 ##RPNT

C Z-ADD0 ##INSL

C EXSR $V03 Pre-Display

C END

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

Page 57: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 55 Interactive Program: Detail Description

2.37 Subfile Format : Pointer 10.

C ##RPNT IFEQ 10

C Z-ADD20 ##RPNT

C*

C MOVEL'1' *IN97

C WRITES03CTL SFLCLR

C MOVEL'0' *IN97

C*

C Z-ADD0 ##RN03

C Z-ADD0 ##RH03

C MOVEL'N' ##ES03

C MOVEL'N' ##EF03

C MOVEL'N' ##RA03

C MOVEL'N' ##NDSP

C*

C ##KL02 SETLLMNCUMAR2 87

C *IN87 IFEQ '1'

C MOVEL'Y' ##EF03

C ##ST03 IFEQ 'Y'

C MOVEL'Y' ##ES03

C END

C END

C*

C 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).

Page 58: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 56 Interactive Program: Detail Description

2.38 Subfile Format : Pointer 20.

C ##RPNT IFEQ 20

C Z-ADD30 ##RPNT

C*

C Z-ADD0 ##SFLL

C ##SFLL DOWLT12 SFLLOAD

C ##EF03 IFEQ 'N'

C READ MNCUMAR2 N 89

C *IN89 IFEQ '1'

C MOVEL'Y' ##EF03

C ##ST03 IFEQ 'Y'

C MOVEL'Y' ##ES03

C END

C END

C END

C ##ES03 IFEQ 'Y'

C Z-ADD12 ##SFLL

C ELSE

C ##EF03 IFEQ 'Y'

C MOVEL'N' ##NDSP

C EXSR $B02

C EXSR $I03

C ELSE

C EXSR $R03

C ##NDSP IFEQ 'N'

C EXSR $F02

C EXSR $A03

C END

C END

C ##NDSP IFEQ 'N'

C ADD 1 ##RN03

C ADD 1 ##SFLL

C WRITES03SFL

C ELSE

C MOVEL'N' ##NDSP

C END

C END

C END

C*

C ##EF03 IFEQ 'N' SAVE KEYS

C MOVELCUNMCU ##0103

C END

C*

C Z-ADD##RN03 ##RS03 SET RRN

C Z-ADD##RN03 ##RH03

C*

C ##ES03 IFEQ 'N' Subfile End?

C ##EF03 ANDEQ'N'

C Z-ADD##RF02 ##RL03

C MOVEL*BLANKS ##SWES

C ##SWES DOWEQ*BLANKS

C READ MNCUMAR2 89

C *IN89 IFEQ '1'

C MOVEL'S' ##SWES

C MOVEL'Y' ##EF03

C ##ST03 IFEQ 'Y'

C MOVEL'Y' ##ES03

C END

C ELSE

C EXSR $R03

C ##NDSP IFEQ 'Y'

C MOVEL'N' ##NDSP

C ELSE

C MOVEL'S' ##SWES

C END

C ##EF03 IFEQ 'Y'

C MOVEL'S' ##SWES

C END

C END

C END

C END

C*

C END

Page 59: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 57 Interactive Program: Detail Description

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).

Page 60: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 58 Interactive Program: Detail Description

2.39 Subfile Format : Pointer 30. Whithout error subfile

C ##RPNT IFEQ 30

C Z-ADD40 ##RPNT

C Z-ADD##F ##ERNR

C ##F IFEQ 0

C MOVEL*BLANKS ##MESS

C ELSE

C OUT ##PARM

C CALL 'IP010RGB'##PLMS

C *LOCK IN ##PARM

C Z-ADD0 ##F

C END

C EXSR $D03

C END

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

Page 61: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 59 Interactive Program: Detail Description

2.40 Subfile Format : Pointer 10-20-30. With error subfile

C ##RPNT IFEQ 10

C ##RPNT OREQ 20

C ##RPNT OREQ 30

C Z-ADD40 ##RPNT

C ##F IFEQ 0

C CALL 'IP060CLB'##PLES

C Z-ADD0 ##F

C END

C EXSR $D03

C END

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

Page 62: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 60 Interactive Program: Detail Description

2.41 Subfile Format : Pointer 40.

C ##RPNT IFEQ 40

C Z-ADD50 ##RPNT

C*

C ##RH03 IFEQ 0

C MOVEL'0' *IN96

C ELSE

C MOVEL'1' *IN96

C END

C*

C ##ES03 IFEQ 'N'

C MOVEL'0' *IN84

C ELSE

C MOVEL'1' *IN84

C END

C*

C ##PREV IFNE 03

C MOVEL'0' *IN81

C MOVEL'0' *IN82

C MOVEL'0' *IN91

C ELSE

C MOVEL'1' *IN81

C MOVEL'1' *IN82

C MOVEL'1' *IN91

C ##NEW IFEQ '0'

C MOVEL'1' ##NEW

C MOVEL'0' *IN81

C END

C END

C*

C ##OVRL IFEQ '0'

C MOVEL'0' *IN92

C ELSE

C MOVEL'1' *IN92

C END

C*

C ##INSL IFLT 1

C ##INSL ORGT 1

C Z-ADD1 ##INSL

C END Messages

C*

C WRITEM03CTL Error subfile

C MOVEL'1' *IN92 Error subfile

C*

C ##INSL IFEQ 1

C WRITES03IL1

C END

C*

C MOVEL'1' *IN92

C*

C Z-ADD03 ##PREV

C EXFMTS03CTL

C MOVEL'0' *IN81

C MOVEL'0' *IN82

C MOVEL'0' *IN91

C MOVEL'0' *IN96

C*

C 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

Page 63: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 61 Interactive Program: Detail Description

2.42 Subfile Format : Pointer 50. Whithout UIM help

C ##RPNT IFEQ 50

C Z-ADD60 ##RPNT

C*

C *IN99 DOWEQ'1' HELP

C *INKY OREQ '1' CF24

C *IN99 IFEQ '1'

C MOVE ##LNNR ##ALF

C Z-ADD##BIN ##LINE

C MOVE ##PSNR ##ALF

C Z-ADD##BIN ##POS

C Z-ADD0 ##PREV

C OUT ##PARM

C CALL 'IP250RGB'##PLHT

C *LOCK IN ##PARM

C MOVEL'0' *IN99

C MOVEL'1' *IN91

C END

C *INKY IFEQ '1'

C MOVEL'1' *IN91

C ##OVRL IFEQ '0'

C MOVEL'0' *IN92

C ELSE

C MOVEL'1' *IN92

C END

C ADD 1 ##INSL

C ##INSL IFLT 1

C ##INSL ORGT 1

C Z-ADD1 ##INSL

C END

C ##INSL IFEQ 1

C WRITES03IL1

C END

C END

C MOVEL'1' *IN92

C WRITES03CTL

C READ S03CTL 89

C ##RFDF IFNE 0

C Z-ADD##RFDF ##RS03

C END

C END

C*

C MOVEL'0' *IN91

C MOVEL'0' *IN92

C Z-ADD0 ##LINE

C Z-ADD0 ##POS

C MOVEA##I *IN,1

C CALL 'IP061CLB' Error subfile

C*

C *IN95 IFEQ '1' Roll Up

C Z-ADD20 ##RPNT

C Z-ADD##RH03 ##RN03

C ##EF03 IFEQ 'N'

C MOVEL##0103 CUNM02

C ##KL02 SETLLMNCUMAR2 87

C *IN87 IFEQ '1'

C MOVEL'Y' ##EF03

C ELSE

C ##RF02 DOUEQ##RL03

C READ MNCUMAR2 89

C *IN89 IFEQ '1'

C MOVEL'Y' ##EF03

C Z-ADD##RL03 ##RF02

C ELSE

C CUNMCU IFNE ##0103

C ##KL02 SETLLMNCUMAR2

C Z-ADD##RL03 ##RF02

C END

C END

C END

C END

C END

C ELSE

C EXSR $C03

C END

C*

C END

Page 64: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 62 Interactive Program: Detail Description

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.

Page 65: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 63 Interactive Program: Detail Description

2.43 Subfile Format : Pointer 50. With UIM help

C ##RPNT IFEQ 50

C Z-ADD60 ##RPNT

C*

C MOVEL'0' *IN91

C MOVEL'0' *IN92

C Z-ADD0 ##LINE

C Z-ADD0 ##POS

C MOVEA##I *IN,1

C CALL 'IP061CLB' Error subfile

C*

C *IN95 IFEQ '1' Roll Up

C Z-ADD20 ##RPNT

C Z-ADD##RH03 ##RN03

C ##EF03 IFEQ 'N'

C MOVEL##0103 CUNM02

C ##KL02 SETLLMNCUMAR2 87

C *IN87 IFEQ '1'

C MOVEL'Y' ##EF03

C ELSE

C ##RF02 DOUEQ##RL03

C READ MNCUMAR2 89

C *IN89 IFEQ '1'

C MOVEL'Y' ##EF03

C Z-ADD##RL03 ##RF02

C ELSE

C CUNMCU IFNE ##0103

C ##KL02 SETLLMNCUMAR2

C Z-ADD##RL03 ##RF02

C END

C END

C END

C END

C END

C ELSE

C EXSR $C03

C END

C*

C END

Page 66: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 64 Interactive Program: Detail Description

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.

Page 67: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 65 Interactive Program: Detail Description

2.44 Subfile Format : Pointer 60.

C ##RPNT IFEQ 60

C Z-ADD61 ##RPNT

C EXSR $L03

C END

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).

Page 68: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 66 Interactive Program: Detail Description

2.45 Subfile Format : Pointer 61.

C ##RPNT IFEQ 61

C Z-ADD62 ##RPNT

C ##RH03 IFNE 0

C Z-ADD03 ##TF99

C READCS03SFL 80

C *IN80 DOWEQ'0'

C EXSR $X03

C ##RPNT IFEQ 62

C READCS03SFL 80

C ELSE

C MOVEL'1' *IN80

C END

C END

C END

C END

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.

Page 69: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 67 Interactive Program: Detail Description

2.46 Subfile Format : Pointer 62.

C ##RPNT IFEQ 62

C Z-ADD90 ##RPNT

C Z-ADD0 ##TF99

C EXSR $P03

C*

C MOVEL'0' ##AD03

C MOVEL'0' ##UP03

C MOVEL'0' ##DL03

C*

C ##TF03 IFNE 0

C Z-ADD##TF03 ##TF99

C END

C*

C 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.

Page 70: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 68 Interactive Program: Detail Description

2.47 Subfile Format : Pointer 90.

C ##RPNT IFEQ 90

C Z-ADD99 ##RPNT

C*

C ##TF99 IFNE 0

C Z-ADD##TF99 ##NSBR

C Z-ADD0 ##TF99

C Z-ADD61 ##NPNT

C ELSE

C MOVEL'0' ##OVRL

C Z-ADD##NSBR ##PSBR

C Z-ADD##NPNT ##PPNT

C Z-ADD01 ##NSBR

C Z-ADD01 ##NPNT

C END

C*

C END

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

Page 71: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 69 Interactive Program: Detail Description

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.

Page 72: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 70 Interactive Program: Detail Description

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.

Page 73: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 71 Interactive Program: Detail Description

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).

Page 74: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 72 Interactive Program: Detail Description

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)

Page 75: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 73 Interactive Program: Detail Description

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.

Page 76: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 74 Interactive Program: Detail Description

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.

Page 77: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 75 Interactive Program: Detail Description

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.

Page 78: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 76 Interactive Program: Detail Description

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.

Page 79: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 77 Interactive Program: Detail Description

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.

Page 80: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 78 Interactive Program: Detail Description

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

Page 81: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 79 Interactive Program: Detail Description

C MOVEL'N' ##NDSP 1

C MOVEL*BLANKS ##SWES 1

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

C* IDDOS : Generator fields : format 01

C*

C MOVEL'0' ##AD01 1

C MOVEL'0' ##UP01 1

C MOVEL'0' ##DL01 1

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

C* IDDOS : Generator fields : format 02

C*

C MOVEL'0' ##AD02 1

C MOVEL'0' ##UP02 1

C MOVEL'0' ##DL02 1

C Z-ADD6 ##WL02 Only if window

C Z-ADD12 ##WP02 Only if window

C Z-ADD0 ##WC02 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

Page 82: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 80 Interactive Program: Detail Description

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.

Page 83: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 81 Interactive Program: Detail Description

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.

Page 84: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 82 Interactive Program: Detail Description

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.

Page 85: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 83 Interactive Program: Detail Description

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 P Century support

C MOVEL'*ISO' ##FMIC P Century support

C MOVEL'S ' ##FMOC P Century support

C CALL 'IP032RGB'##PLCS Century support

C MOVEL##DTOC DATE#1 P Century support

C*

C $F01ZZ ENDSR

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.

Page 86: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 84 Interactive Program: Detail Description

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 P Century support

C MOVEL'S ' ##FMIC P Century support

C MOVEL'*ISO' ##FMOC P Century support

C CALL 'IP032RGB'##PLCS Century support

C MOVEL##DTOC DATECU P Century support

C*

C $T01ZZ ENDSR

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.

Page 87: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 85 Interactive Program: Detail Description

2.62 File Handling : Initialize non-key fields.

C $B01 BEGSR

C*

C*IDDOS: Init non-key fields

C*

C MOVEL*BLANKS CUNM#1

C MOVEL*BLANKS CUAD#1

C MOVEL*BLANKS CUZP#1

C MOVEL*BLANKS CUCT#1

C MOVEL*BLANKS CUAC#1

C Z-ADD*ZEROS CUDT#1

C*

C $B01ZZ 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.

Page 88: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 86 Interactive Program: Detail Description

2.63 File Handling : Fill keylist.

C $K01 BEGSR

C*

C*IDDOS: Fill keylist from screen

C*

C MOVELCUCD#1 CUCD01

C*

C $K01ZZ 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.

Page 89: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 87 Interactive Program: Detail Description

2.64 Date conversion routine.

C $U99 BEGSR

C ##FMTI IFEQ 'S'

C MOVE ##DTSV ##FMTI

C ENDIF

C ##FMTO IFEQ 'S'

C MOVE ##DTSV ##FMTO

C ENDIF

C*

C ##FMTI IFEQ ##FMTO

C ##DATI OREQ '000000'

C ##DATI OREQ ' '

C MOVE *ZEROS ##DATC

C MOVE ##DATI ##DATO

C ELSE

C ##FMTI IFEQ 'D'

C MOVE ##DATI ##DDAT

C ##FMTO IFEQ 'M'

C MOVE ##DDD ##MDD

C MOVE ##DMM ##MMM

C MOVE ##DYY ##MYY

C MOVE ##MDAT ##DATO

C ENDIF

C ##FMTO IFEQ 'Y'

C MOVE ##DDD ##YDD

C MOVE ##DMM ##YMM

C MOVE ##DYY ##YYY

C MOVE ##YDAT ##DATO

C ENDIF

C ##FMTO IFEQ 'C'

C MOVE ##DDD ##CDD

C MOVE ##DMM ##CMM

C MOVE ##DYY ##CYY

C ##CYY IFGE '40'

C MOVE '0' ##CCC

C ELSE

C MOVE '1' ##CCC

C ENDIF

C MOVE ##CDAT ##DATC

C ENDIF

C ENDIF

C ##FMTI IFEQ 'M'

C MOVE ##DATI ##MDAT

C ##FMTO IFEQ 'D'

C MOVE ##MMM ##DMM

C MOVE ##MDD ##DDD

C MOVE ##MYY ##DYY

C MOVE ##DDAT ##DATO

C ENDIF

C ##FMTO IFEQ 'Y'

C MOVE ##MMM ##YMM

C MOVE ##MDD ##YDD

C MOVE ##MYY ##YYY

C MOVE ##YDAT ##DATO

C ENDIF

C ##FMTO IFEQ 'C'

C MOVE ##MDD ##CDD

C MOVE ##MMM ##CMM

C MOVE ##MYY ##CYY

C ##CYY IFGE '40'

C MOVE '0' ##CCC

C ELSE

C MOVE '1' ##CCC

C ENDIF

C MOVE ##CDAT ##DATC

C ENDIF

C ENDIF

C ##FMTI IFEQ 'Y'

C MOVE ##DATI ##YDAT

C ##FMTO IFEQ 'D'

C MOVE ##YYY ##DYY

Page 90: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 88 Interactive Program: Detail Description

C MOVE ##YMM ##DMM

C MOVE ##YDD ##DDD

C MOVE ##DDAT ##DATO

C ENDIF

C ##FMTO IFEQ 'M'

C MOVE ##YYY ##MYY

C MOVE ##YMM ##MMM

C MOVE ##YDD ##MDD

C MOVE ##MDAT ##DATO

C ENDIF

C ##FMTO IFEQ 'C'

C MOVE ##YDD ##CDD

C MOVE ##YMM ##CMM

C MOVE ##YYY ##CYY

C ##CYY IFGE '40'

C MOVE '0' ##CCC

C ELSE

C MOVE '1' ##CCC

C ENDIF

C MOVE ##CDAT ##DATC

C ENDIF

C ENDIF

C ##FMTI IFEQ 'C'

C MOVE ##DATI ##CDAT

C ##FMTO IFEQ 'D'

C MOVE ##CYY ##DYY

C MOVE ##CMM ##DMM

C MOVE ##CDD ##DDD

C MOVE ##DDAT ##DATO

C ENDIF

C ##FMTO IFEQ 'M'

C MOVE ##CYY ##MYY

C MOVE ##CMM ##MMM

C MOVE ##CDD ##MDD

C MOVE ##MDAT ##DATO

C ENDIF

C ##FMTO IFEQ 'Y'

C MOVE ##CMM ##YMM

C MOVE ##CDD ##YDD

C MOVE ##CYY ##YYY

C MOVE ##YDAT ##DATO

C ENDIF

C ENDIF

C ENDIF

C $U99ZZ ENDSR

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.

Page 91: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 89 Interactive Program: Detail Description

2.65 Program tables.

*-----------------------------------------------------------

*IDDOS: Tables

*-----------------------------------------------------------

*

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

*IDDOS: User code : Tables

*

This is the user process point to enter program table contents.

Page 92: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 90 Interactive Program: Detail Description

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

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

: INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID037RGI :

: 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 :

: :

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

Page 93: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 91 Interactive Program: Detail Description

This entry will result in the following code :

C*

C*IDDOS: Generated data base access

C*IDDOS: Access: Input

C*IDDOS: File : MNCUMAL1

C*

C EXSR $K01

C *IN88 DOUEQ'0'

C ##KL01 CHAINMNCUMAR 8788

C *IN88 IFEQ '1'

C EXSR *PSSR

C END

C END

C *IN87 IFEQ '0'

C EXSR $F01

C EXCPTREL01

C ELSE

C EXSR $B01

C END

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.

Page 94: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 92 Interactive Program: Detail Description

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

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

: INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID037RGI :

: 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 :

: :

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

Page 95: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 93 Interactive Program: Detail Description

This entry will result in the following code :

C*IDDOS: Generated data base access

C*IDDOS: Access: update add

C*IDDOS: File : MNCUMAL1

C*

C EXSR $K01

C *IN88 DOUEQ'0'

C ##KL01 CHAINMNCUMAR 8788

C *IN88 IFEQ '1'

C EXSR *PSSR

C END

C END

C *IN87 IFEQ '0'

C ##DL02 IFEQ '1'

C DELETMNCUMAR

C ELSE

C EXSR $T01

C UPDATMNCUMAR

C END

C ELSE

C ##DL02 IFNE '1'

C EXSR $T01

C WRITEMNCUMAR

C END

C END

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.

Page 96: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 94 Interactive Program: Detail Description

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

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

: INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID005RGI :

: 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 :

: :

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

Page 97: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 95 Interactive Program: Detail Description

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 Error subfile

C Z-ADD0 ##F Error subfile

C Z-ADD30 ##RPNT

C GOTO $P02ZZ

C END

C*Check values/ranges for CUAC#1

Generated comment line

C MOVEL*BLANKS ##DDCD

C MOVEL'CUAC' ##DDCD

The attribute name of the field to be controlled must be placed in the ##DDCD parameter field.

C MOVEL*BLANKS ##CVAL

C MOVELCUAC#1 ##CVAL

The contents of the screen field must be placed in the ##CVAL parameter field.

C OUT ##PARM

C CALL 'IP020RGB'##PLVR

C *LOCK 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

Page 98: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 96 Interactive Program: Detail Description

C MOVEL'1' *IN06

C Z-ADD999 ##F

C CALL 'IP060CLB'##PLES Error subfile

C Z-ADD0 ##F Error subfile

C Z-ADD30 ##RPNT

C GOTO $P02ZZ

C END

The error number 999 is used for value checks. The error number 998 is used for range checks.

Page 99: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 97 Interactive Program: Detail Description

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 :

: :

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

Page 100: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 98 Interactive Program: Detail Description

The following code will be generated :

C*IDDOS: Generated database check

C*IDDOS: Field : CUZP#1

C*IDDOS: File : WSZIPCL1

C*

C MOVELCUZP#1 CUZP01

C ##KL01 CHAINWSZIPCR 87

C *IN87 IFEQ '1'

C MOVEL'1' *IN03

C ##F IFEQ 0

C Z-ADD00995 ##F

C CALL 'IP060CLB'##PLES Error subfile

C Z-ADD0 ##F Error subfile

C END

C Z-ADD30 ##RPNT

C GOTO $P02ZZ

C END

C*IDDOS: Generated database check

C*IDDOS: Field : CUZP#1

C*IDDOS: File : WSZIPCL1

C*

Generated comment line

C MOVELCUZP#1 CUZP01

Fill up the key field.

C ##KL01 CHAINWSZIPCR 87

C *IN87 IFEQ '1'

C MOVEL'1' *IN03

C ##F IFEQ 0

C Z-ADD00995 ##F

C CALL 'IP060CLB'##PLES Error subfile

C Z-ADD0 ##F Error subfile

C END

C Z-ADD30 ##RPNT

C GOTO $P02ZZ

C END

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.

Page 101: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 99 Interactive Program: Detail Description

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

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

: INTEGRATED DEVELOPMENT & DOCUMENTATION SYSTEM Documentation system ID005RGI :

: 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 Error subfile

C Z-ADD0 ##F Error subfile

C Z-ADD30 ##RPNT

C GOTO $P02ZZ

C END

C*Check date for CUDT#1

Page 102: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 100 Interactive Program: Detail Description

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 OUT ##PARM

C CALL 'IP030RGB'##PLDT

C *LOCK 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.

Page 103: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 101 Interactive Program: Detail Description

C MOVEL'1' *IN..

C Z-ADD997 ##F

C CALL 'IP060CLB'##PLES Error subfile

C Z-ADD0 ##F Error subfile

C Z-ADD30 ##RPNT

C GOTO $P02ZZ

C END

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 P

C MOVEL'*ISO' ##FMIC P

C MOVEL'S ' ##FMOC P

C MOVEL*BLANKS ##DTOC

C CALL 'IP031RGB'##PLCS

C ##DATO 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 MOVEL'1' *IN..

C Z-ADD997 ##F

C CALL 'IP060CLB'##PLES Error subfile

C Z-ADD0 ##F Error subfile

C Z-ADD30 ##RPNT

C GOTO $P02ZZ

C END

Page 104: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 102 Interactive Program: Detail Description

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.. IFEQ '1'

C EXSR ......

C OUT ##PARM

C CALL '........'......

C *LOCK IN ##PARM

C MOVEL'.' ##AD..

C MOVEL'.' ##UP..

C MOVEL'.' ##DL..

C MOVEL'0' ##OVRL

C Z-ADD.. ##NSBR

C Z-ADD.. ##NPNT

C Z-ADD99 ##RPNT

C EXSR ......

C END

C* .... ..........

On the first line, the text entered for the command key, is generated as a comment statement.

Page 105: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 103 Interactive Program: Detail Description

*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 OUT ##PARM

C CALL '........'......

C *LOCK 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 MOVEL'.' ##AD..

C MOVEL'.' ##UP..

C MOVEL'.' ##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 MOVEL'0' ##OVRL

C Z-ADD.. ##NSBR

C Z-ADD.. ##NPNT

C Z-ADD99 ##RPNT

Page 106: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 104 Interactive Program: Detail Description

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.

Page 107: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 105 Interactive Program: Detail Description

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.

Page 108: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 106 Interactive Program: Detail Description

2.72 Displaying errors on the screen.

To display errors on the screen, the following code can be used:

C ..........test...........

C MOVEL'1' *IN..

C Z-ADD... ##F

C CALL 'IP060CLB' Error subfile

C Z-ADD0 ##F Error subfile

C Z-ADD30 ##RPNT

C GOTO $P..ZZ

C END

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.

Page 109: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 107 Interactive Program: Detail Description

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 ..........test 1 ........

C MOVEL'1' *IN..

C ##F IFEQ 0

C Z-ADD... ##F

C CALL 'IP060CLB' Error subfile

C Z-ADD0 ##F Error subfile

C Z-ADD30 ##RPNT

C END

C END

C*

C ..........test 2 ........

C MOVEL'1' *IN..

C ##F IFEQ 0

C Z-ADD... ##F

C CALL 'IP060CLB' Error subfile

C Z-ADD0 ##F Error subfile

C Z-ADD30 ##RPNT

C END

C END

C*...

C ..........test 3 ........

C MOVEL'1' *IN..

C ##F IFEQ 0

C Z-ADD... ##F

C CALL 'IP060CLB' Error subfile

C Z-ADD0 ##F Error subfile

C Z-ADD30 ##RPNT

C END

C END

C*

C ##RPNT IFEQ 30

C GOTO $P..ZZ

C 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.

Page 110: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 108 Interactive Program: Detail Description

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 ...if record no longer in the group ....

C MOVEL'Y' ##NDSP

C MOVEL'Y' ##EFnn

C ##STnn IFEQ 'Y'

C MOVEL'Y' ##ESnn

C END

C 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'.

Page 111: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 109 Interactive Program: Detail Description

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.

Page 112: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 110 Interactive Program: Detail Description

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.

Page 113: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 111 Interactive Program: Detail Description

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

Page 114: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 112 Interactive Program: Detail Description

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.

Page 115: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 113 Interactive Program: Detail Description

$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

Page 116: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 114 Interactive Program: Detail Description

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

Page 117: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 115 Interactive Program: Detail Description

− ##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.

Page 118: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 116 Interactive Program: Detail Description

− ##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

Page 119: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 117 Interactive Program: Detail Description

− ##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' = 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.

Page 120: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 118 Interactive Program: Detail Description

− ##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.

Page 121: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 119 Interactive Program: Detail Description

− ##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.

Page 122: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 120 Interactive Program: Detail Description

− ##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.

Page 123: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 121 Interactive Program: Detail Description

− ##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.

Page 124: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 122 Interactive Program: Detail Description

− ##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.

Page 125: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 123 Interactive Program: Detail Description

− ##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).

Page 126: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 124 Interactive Program: Detail Description

− ##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.

Page 127: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 125 Interactive Program: Detail Description

− ##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.

Page 128: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 126 Interactive Program: Detail Description

− ##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

Page 129: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 127 Interactive Program: Detail Description

− ##TF99 P(2,0) General transfer flag. Used to control multiple subfile select processing

Page 130: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 128 Interactive Program: Detail Description

− ##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.

Page 131: TABLE OF CONTENTSiseries.realdolmen.com/iddos/pdf/RPG02 - Interactive Program - Detai… · table of contents rpg02: interactive program : detail description. ..... 1 2.1 the example

Manual IDDOS 13 RPG02 129 Interactive Program: Detail Description

− ##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.