HP 3000 Manuals

Generating FORMSFILE Definitions [ HP SYSTEM DICTIONARY XL COBOL DEFINITION EXTRACTOR Reference Manual ] MPE/iX 5.0 Documentation


HP SYSTEM DICTIONARY XL COBOL DEFINITION EXTRACTOR Reference Manual

Generating FORMSFILE Definitions 

If you specify FORMSFILE as the entity type in the GENERATE command,
SDCDE generates a complete set of COBOL record definitions for the forms
contained in the given forms file.  To determine whether to generate all
forms and constants in one module, or in separate modules, SDCDE issues
the following prompt:

     Define all forms in one module (Y/N) >

If you enter a [[RETURN]] or a Y, SDCDE writes all generated code to a
single module.  If you set the CONSTANTS parameter of the OPTIONS command
to ON, the generated code also includes the forms file name, lockword,
headform name, and each form name.  If you enter an N, each form is
written to a separate module, and if the CONSTANTS parameter is set to
ON, the forms file name, lockword, and headform name are written to their
own module.  The SDCDE prompts depend on the choice of single or multiple
module options.

Using a Single Module 

Once the single module option has been chosen, SDCDE issues a prompt
requesting the module name:

     Module name for FORMSFILE forms-file-name >

If the given module name already exists in the current copy library, the
copy library's OPEN-MODE parameter determines whether to append all
generated code to the existing module or to replace the existing module.
If you enter a [[RETURN]] for the module name, SDCDE does not generate
any code for the forms file and the GENERATE command will be complete.

If you specify the ELEM-QUALIFY parameter of the OPTIONS command, SDCDE
responds with one of the following prompts, depending on the value you
specify:

Value            Prompt 

PREFIX           Element prefix >

SUFFIX           Element suffix >

NONE             No prompt

SDCDE attaches the prefix or suffix characters to the elements contained
by the forms in the forms file.  If you enter a [[RETURN]], SDCDE does
not attach a prefix or suffix.

If you set the CONSTANTS parameter of the OPTIONS command to ON, SDCDE
issues a prompt for generating a field number table for each form in the
forms file.  This prompt has the following form:

     Define field number tables (N/Y) >

If you enter a [[RETURN]] or an N, SDCDE does not define tables.  If you
enter a Y, SDCDE defines a field number table following each form.

Each form's constants follow the form's definition.  The forms file
constants follow the last form.  (See "Using Multiple Modules" and
"Generating FORM Definitions" for further explanation.)

Note that the constants generated for the forms file name and the form
names are taken from the vplus-alias attribute value if one exists, and
from the primary name if no vplus-alias attribute value exists.

In all cases SDCDE issues a prompt to determine if the numeric fields of
each form should be defined with a PIC 9 or a PIC X. Note that the
elements defined as numeric in System Dictionary only appear as ASCII
fields in the VPLUS buffer.  SDCDE issues the following prompt to
determine whether these numeric fields have a PIC 9 or a PIC X
description:

     Define numeric fields as PIC 9 or PIC X (9/X) >

If you enter a [[RETURN]] or a 9, SDCDE uses a PIC 9 description,
otherwise, a PIC X description is used.

When answers to the prompts are complete, SDCDE generates the code in the
specified module for the forms file definition.  If you set the QUALIFY
parameter of the OPTIONS command to ON, SDCDE prefixes all forms with the
forms file name.  If you set the COMMON-STORE parameter of the OPTIONS
command to ON, all forms occupy the same memory space via the REDEFINES
clause.

Example 

In the following single module example, the forms file name is ORDERFF,
ELEM-QUALIFY = PREFIX, and CONSTANTS = ON.

     Define all forms in one module (Y/N) > Y 
     Module name for FORMSFILE ORDERFF > FORMFILE 
     Element prefix > [[RETURN]]
     Define field number tables (N/Y) > N 
     Define numeric fields as PIC 9 or PIC X (9/X) > 9 

     000100
     000200  01  CUSTOMER-FORM-DATA.
     000300      05  CUST-ACCT              PIC X(8).
     000400      05  CUST-NAME              PIC X(30).
     000500      05  CUST-ADDRESS           PIC X(60).
     000600
     000700  01  FORM-CUSTOMER-FORM         PIC X(14)  VALUE "CUSTOMER-FORM ".
     000800
     000900  01  ORDER-FORM-DATA.
     001000      05  PROD-NO                PIC X(15).
     001100      05  QUANTITY               PIC 9(8).
     001200      05  UNIT-PRICE             PIC X(12).
     001300      05  TOTAL                  PIC X(12).
     001400
     001500  01  FORM-ORDER-FORM            PIC X(11)  VALUE "ORDER-FORM ".
     001600
     001700  01  FF-ORDERFF                 PIC X(8)   VALUE "ORDERFF ".
     001800  01  LWD-ORDERFF                PIC X(6)   VALUE "lockff".
     001900  01  HF-ORDERFF                 PIC X(11)  VALUE "ORDER-FORM ".
     002000

Using Multiple Modules 

When you choose the multiple modules option, SDCDE issues a prompt
requesting the module name for the form.  This prompt has the following
form:

     Module name for FORM form-name >

If you enter a [[RETURN]] for the module name, SDCDE does not generate
any code for the form, and continues to the next form in the forms file.

If you specify the ELEM-QUALIFY parameter of the OPTIONS command, SDCDE
responds with one of the following prompts, depending on the value you
specify:

Value            Prompt 

PREFIX           Element prefix >

SUFFIX           Element suffix >

NONE             No prompt

SDCDE attaches the prefix or suffix characters to the elements contained
by the current form.  If you enter a [[RETURN]], SDCDE does not attach
prefix or suffix.

If you set the CONSTANTS parameter of the OPTIONS command to ON, SDCDE
issues a prompt for generating a field number table for the current form.
This prompt has the following form:

     Define field number tables (N/Y) >

If you enter a [[RETURN]] or an N, SDCDE does not define a table.  If you
enter a Y, SDCDE defines a field number table for the form.  In all
cases, SDCDE issues a prompt to determine if the numeric fields of the
form should be defined with a PIC 9 or a PIC X. The prompt has the
following form:

     Define numeric fields as PIC 9 or PIC X (9/X) >

If you enter a [[RETURN]] or a 9, SDCDE uses a PIC 9 description.  If you
enter an X, SDCDE uses a PIC X description.

When answers to these prompts are complete, SDCDE generates the code in
the specified module for the current form.  If the current forms' field
table and form name constants are to be generated, they appear at the end
of the module.  If you set the QUALIFY parameter of the OPTIONS command
to ON, SDCDE prefixes the form's name with the forms file name.  If you
set the COMMON-STORE parameter of the OPTIONS command to ON, all forms
occupy the same memory space via the REDEFINES clause.  If you set the
ECHO parameter of the OPTIONS command to ON, all generated code is
displayed on the $STDLIST device before continuing with the next form.

The previous steps are repeated for every form in the forms file.  When
all forms have been defined, and if you set the CONSTANTS parameter to
ON, SDCDE issues a prompt requesting the module name for the forms file
name, lockword, and head form name constants.  The prompt has the
following form:

     Module name for FORMSFILE forms-file-name's constants >

The forms file constants generated here include the forms file name, its
lockword (if any), and the head form's name.  The lockword is obtained
from the lockword attribute of the FORMSFILE entity.  SDCDE uses the
head-form attribute of the FORMSFILE contains FORM relationship to
determine the head form name.  SDCDE uses the vplus-alias attribute value
to determine the form name, forms file name, and head form name.
Determination of the head form is similar to that of the primary record
determination process described in Chapter 5.  If you enter a [[RETURN]],
SDCDE does not generate any constants.

If a module name already exists in the current copy library, the copy
library's OPEN-MODE parameter determines whether to append all generated
code to the existing module or to replace the existing module.

Example 

In the following multiple module example, the forms file name is ORDERFF,
ELEM-QUALIFY = SUFFIX, and CONSTANTS = ON.

     Define all forms in one module (Y/N) > N 

     Module name for FORM ORDER-FORM-ONE > ORDERFF1 
     Element suffix > -F1 

     Define field number tables (N/Y) > Y 
     Define numeric fields as PIC 9 or PIC X (9/X) > 9 

     000100
     000200  01  CUSTOMER-FORM-DATA.
     000300      05  CUST-ACCT-F1           PIC X(8).
     000400      05  CUST-NAME-F1           PIC X(30).
     000500      05  CUST-ADDRESS-F1        PIC X(60).
     000600
     000700  01  CUSTOMER-FORM-FIELDS.
     000800      05  FIELDNO-CUST-ACCT-F1   PIC S9(4)  COMP  VALUE 1.
     000900      05  FIELDNO-CUST-NAME-F1   PIC S9(4)  COMP  VALUE 2.
     001000      05  FIELDNO-CUST-ADDRESS-F1   PIC S9(4)  COMP  VALUE 3.
     001100
     001200  01  FORM-CUSTOMER-FORM         PIC X(14)  VALUE "CUSTOMER-FORM ".
     001300

     Module name for FORM ORDER-FORM-TWO > ORDERFF2 
     Element suffix > -F2 

     Define field number tables (N/Y) > Y 
     Define numeric fields as PIC 9 or PIC X (9/X) > 9 

     000100
     000200  01  ORDER-FORM-DATA.
     000300      05  PROD-NO-F2             PIC X(15).
     000400      05  QUANTITY-F2            PIC 9(8).
     000500      05  UNIT-PRICE-F2          PIC X(12).
     000600      05  TOTAL-F2               PIC X(12).
     000700
     000800  01  ORDER-FORM-FIELDS.
     000900      05  FIELDNO-PROD-NO-F2     PIC S9(4)  COMP  VALUE 1.
     001000      05  FIELDNO-QUANTITY-F2    PIC S9(4)  COMP  VALUE 2.
     001100      05  FIELDNO-UNIT-PRICE-F2  PIC S9(4)  COMP  VALUE 3.
     001200      05  FIELDNO-TOTAL-F2       PIC S9(4)  COMP  VALUE 4.
     001300
     001400  01  FORM-ORDER-FORM            PIC X(11)  VALUE "ORDER-FORM ".
     001500

     Module name for FORMSFILE ORDERFF's constants > ORDERFFC 

     000100
     000200  01  FF-ORDERFF                 PIC X(8)  VALUE "ORDERFF ".
     000300  01  LWD-ORDERFF                PIC X(6)  VALUE "lockff".
     000400  01  HF-ORDERFF                 PIC X(11)  VALUE "CUSTOMER-FORM ".
     000500


MPE/iX 5.0 Documentation