HP 3000 Manuals

Constructing the RPG Program [ HP RPG/XL Utilities-Part 3 SIGEDITOR ] MPE/iX 5.0 Documentation


HP RPG/XL Utilities-Part 3 SIGEDITOR

Constructing the RPG Program 

This section describes the relationship between SIGEDITOR and RPG.
Although this section is not intended to be a detailed description of the
sample program, it may be helpful to refer back to Figure 4-1 as you read
this section.  See the RPG Reference Manual for detailed information
about RPG programming.

SIGEDITOR can generate most of the RPG specifications required to define
the work station (RSI) file and its input/output records.  These
specifications can be included in your RPG program, with only minor
editing.  Figure 4-4 shows the specifications generated from FORM21 and
FORM22.  The sample program was constructed using these specifications.

The forms filename, SAMPLIB, is specified on the "KFORMS" file
continuation record.  SIGEDITOR creates this specification for you.  If
that specification has been omitted, the forms filename would default to
the program name (specified on the "H" specification or with $CONTROL
NAME=) suffixed with "FM".  If the program name is missing, the default
forms filename becomes "RPGOBJFM".  The forms filename can be referenced
by a file equation at runtime to redirect the forms file.

The social security number is split into three fields on the screen to
allow for punctuation.  In the RPG program, the three fields have been
combined into a single field by modifying the "I" specifications so that
it can be used as the key field for the CUSTMAST KSAM file.  The phone
number fields have also been combined into a single field to simplify the
program.

The output specifications for the work station file were also modified to
use the new field names for the social security number and the phone
number.  The error message (ERRMSG) field is used to pass the message
identification (ID) to the form at runtime.  The message ID's in this
example are coded as output constants conditioned by indicators in the
RPG program.  They could be loaded into the field shown instead.

The RPG program can use the command key ("K") indicators to control the
flow of the program as shown in the example.  The command key indicators
are all set off by RPG before each work station input operation.  The
user can turn on one command key indicator by pressing the command key
associated with that indicator.  The forms can use RPG indicators to
control form and field attributes.  The RPG program must set these
indicators before the form is displayed so that the desired functions
will be performed.
___________________________________________________________________________________
|                                                                                 |
|                1         2         3         4         5         6         7    |
|            678901234567890123456789012345678901234567890123456789012345678901234|
|                                                                                 |
|                                                                                 |
|            FWRKSTN  UD  V      6          WORKSTNR                              |
|            F                                           KFORMS SAMPLIB           |
|            IWRKSTN                                                              |
|            I*                                                                   |
|            I* FORM21                                                            |
|            I*                                                                   |
|            I                                     1   1 FLD1                     |
|            I                                     2   40SSN1                     |
|            I                                     5   60SSN2                     |
|            I                                     7  100SSN3                     |
|            I*                                                                   |
|            I* FORM22                                                            |
|            I*                                                                   |
|            I                                     1   1 FLD1                     |
|            I                                     2  27 NAME                     |
|            I                                    28  63 ADDR                     |
|            I                                    64  720ZIP                      |
|            I                                    73  75 PN1                      |
|            I                                    76  78 PN2                      |
|            I                                    79  82 PN3                      |
|            OWRKSTN                                                              |
|            O*                                                                   |
|            O  FORM21                                                            |
|            O*                                                                   |
|            O                                K6 'FORM21'                         |
|            O                      ERRMSG     6                                  |
|            OWRKSTN                                                              |
|            O*                                                                   |
|            O* FORM22                                                            |
|            O*                                                                   |
|            O                                K6  'FORM22'                        |
|            O                      PT1        3                                  |
|            O                      PT2        5                                  |
|            O                      PT3        9                                  |
|            O                      NAME      35                                  |
|            O                      ADDR      71                                  |
|            O                      ZIP       80                                  |
|            O                      PNPT1     83                                  |
|            0                      PNPT2     86                                  |
|            O                      PNPT3     90                                  |
|                                                                                 |
___________________________________________________________________________________

          Figure 5-4.  RPG Specifications 



MPE/iX 5.0 Documentation