HP 3000 Manuals

Generating IMAGE-DATABASE 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 IMAGE-DATABASE Definitions 

If you specify IMAGE-DATABASE as the entity type in the GENERATE command,
a complete set of COBOL record definitions is generated for the data sets
contained in the given database.  To determine whether to generate all
data sets and constants in one module, or in separate modules, SDCDE
issues the following prompt:

     Define all data sets in one module (Y/N) >

If you enter a Y, SDCDE generates all definitions into one module.  If
you respond with an N, SDCDE generates each data set definition and the
constants into different modules.

Using a Single Module 

When you ask for a single module, SDCDE asks for the module name with the
following prompt:

     Module name for IMAGE-DATABASE data-base-name >

Enter the module name into which you wish to generate all data set and
constant definitions.  If the module already exists, the copy library's
OPEN-MODE parameter determines whether to append all generated code to
the existing module or to replace it.  If you enter a [[RETURN]], SDCDE
does not generate any code for this database 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 data sets.  If you enter a [[RETURN]], SDCDE does not attach a
prefix or suffix.

When answers to these prompts are complete, SDCDE starts the source
generation process.  The database definition is created for the
WORKING-STORAGE SECTION, with each data set record corresponding to an 01
level COBOL record, and each element contained in the data set record
corresponding to the 05 level element.  (See "Generating IMAGE-DATASET
definitions" for further explanations regarding data set generation.)

If you set the QUALIFY parameter of the OPTIONS command to ON, then SDCDE
prefixes the COBOL record name for each data set with the database name.

If you set the CONSTANTS parameter of the OPTIONS command to ON, SDCDE
generates the database name and password constants after the record
layouts.  SDCDE then generates the data set names and search item
constants.  The constant values generated use the image-alias attribute
value if one exists, and the primary name if no image-alias attribute
value is found.  This rule applies regardless of the value of the ALIAS
parameter of the OPTIONS command.

If you set the COMMON-STORE parameter of the OPTIONS command to ON, all
data sets in the database occupy the same memory space via the REDEFINES
clause.

Example 

In the following single module example the database name is STORE,
ELEM-QUALIFY = PREFIX, and CONSTANT = ON.

     > GENERATE STORE; ENTITY-TYPE=IMAGE-DATABASE. 

     Define all data sets in one module (Y/N) > Y 
     Module name for IMAGE-DATABASE STORE > MODULE 
     Element prefix > [[RETURN]]

     000100
     000200 01  CUSTOMER-DATA.
     000300     05  ACCOUNT                 PIC S9(9)  COMP.
     000400     05  LAST-NAME               PIC X(16).
     000500     05  FIRST-NAME              PIC X(10).
     000600     05  MID-INITIAL             PIC X(2).
     000700     05  STREET-ADDRESS          PIC X(26).
     000800     05  CITY                    PIC X(12).
     000900     05  STATE                   PIC X(2).
     001000     05  ZIP                     PIC X(6).
     001100     05  CREDIT-RATING           PIC S9(9)  COMP.
     001200
     001300
     001400 01  DATE-MASTER-DATA.
     001500     05  DATE-INFO               PIC X(6).
     001600
     001700
     001800 01  PRODUCT-DATA.
     001900     05  STOCK-NO                PIC X(8).
     002000     05  DESCRIPTION             PIC X(20).
     002100
     002200
     002300 01  SALES-DATA.
     002400     05  ACCOUNT                 PIC S9(9)  COMP.
     002500     05  STOCK-NO                PIC X(8).
     002600     05  QUANTITY                PIC S9(4)  COMP.
     002700     05  PRICE                   PIC S9(9)  COMP.
     002800     05  TAX                     PIC S9(9)  COMP.
     002900     05  TOTAL                   PIC S9(9)  COMP.
     003000     05  PURCH-DATE              PIC X(6).
     003100     05  DELIV-DATE              PIC X(6).
     003200
     003300
     003400 01  SUP-MASTER-DATA.
     003500     05  SUPPLIER                PIC X(16).
     003600     05  STREET-ADDRESS          PIC X(26).
     003700     05  CITY                    PIC X(12).
     003800     05  STATE                   PIC X(2).
     003900     05  ZIP                     PIC X(6).
     004000
     004100
     004200 01  INVENTORY-DATA.
     004300     05  STOCK-NO                PIC X(8).
     004400     05  ONHANDQTY               PIC S9(9)  COMP.
     004500     05  SUPPLIER                PIC X(16).
     004600     05  UNIT-COST               PIC S9(7)  COMP-3.
     004700     05  LASTSHIPDATE            PIC X(6).
     004800     05  BINNUM                  PIC S9(2).
     004900
     005000
     005100 01  DB-STORE                    PIC X(8)  VALUE "  STORE ".
     005200 01  PWD-STORE                   PIC X(10)  VALUE "PASSWORD ".
     005300
     005400 01  DS-CUSTOMER                 PIC X(9)  VALUE "CUSTOMER ".
     005500 01  DS-DATE-MASTER              PIC X(12)  VALUE "DATE-MASTER ".
     005600 01  DS-PRODUCT                  PIC X(8)  VALUE "PRODUCT ".
     005700 01  DS-SALES                    PIC X(6)  VALUE "SALES ".
     005800 01  DS-SUP-MASTER               PIC X(11)  VALUE "SUP-MASTER ".
     005900 01  DS-INVENTORY                PIC X(10)  VALUE "INVENTORY ".
     006000
     006100 01  DI-ACCOUNT                  PIC X(8)  VALUE "ACCOUNT ".
     006200 01  DI-DATE-INFO                PIC X(11)  VALUE "DATE-INFO ".
     006300 01  DI-STOCK-NO                 PIC X(9)  VALUE "STOCK-NO ".
     006400 01  DI-PURCH-DATE               PIC X(11)  VALUE "PURCH-DATE ".
     006500 01  DI-DELIV-DATE               PIC X(11)  VALUE "DELIV-DATE ".
     006600 01  DI-SUPPLIER                 PIC X(9)  VALUE "SUPPLIER ".
     006700 01  DI-LASTSHIPDATE             PIC X(13)  VALUE "LASTSHIPDATE ".
     006800

Using Multiple Modules 

When multiple modules are requested, SDCDE prompts for the module name
for each data set:

     Module name for IMAGE-DATASET data-set-name >

Specify the module name for the data set definition.  If you enter
[[RETURN]], SDCDE does not generate any code for this data set and
continues to the next data set in the database.  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 data sets.  If you enter a [[RETURN]], SDCDE does not attach a
prefix or suffix.

When answers to these prompts are complete, SDCDE starts the source
generation process for the data set.  If you set the ECHO parameter of
the OPTIONS command to ON, then all generated code is displayed on the
$STDLIST device before continuing with the next data set.

After generating the source for all data sets, SDCDE asks for the module
name for the constants.  Note that SDCDE issues this prompt only if you
set the CONSTANTS parameter of the OPTIONS command to ON:

     Module name for data-base-name's constants >

The database constants generated here include the following:

     data name name
     database passwords
     data set names
     search items

The database passwords are obtained from the IMAGE-CLASS entity
definitions that are related to the database via IMAGE-DATABASE contains
IMAGE-CLASS relationship.  SDCDE uses the value of the password attribute
on the IMAGE-CLASS entity to create the password constants.  The constant
values generated here use the image-alias attribute value if one exists.
If you enter a [[RETURN]] at the prompt, the constants are not generated.

Example 

In the following multiple modules example the database name is STORE,
ELEM-QUALIFY = PREFIX, and CONSTANT = ON.

     > GENERATE STORE; ENTITY-TYPE=IMAGE-DATABASE. 
     Define all data sets in one module (Y/N) > N 
     Module name for IMAGE-DATASET CUSTOMER > CUSTMOD 
     Element prefix > CUST- 

     000100
     000200 01  CUSTOMER-DATA.
     000300     05  CUST-ACCOUNT            PIC S9(9)  COMP.
     000400     05  CUST-LAST-NAME          PIC X(16).
     000500     05  CUST-FIRST-NAME         PIC X(10).
     000600     05  CUST-MID-INITIAL        PIC X(2).
     000700     05  CUST-STREET-ADDRESS     PIC X(26).
     000800     05  CUST-CITY               PIC X(12).
     000900     05  CUST-STATE              PIC X(2).
     001000     05  CUST-ZIP                PIC X(6).
     001100     05  CUST-CREDIT-RATING      PIC S9(9)  COMP.
     001200
     001300

     Module name for IMAGE-DATASET DATE-MASTER > DATEMOD 
     Element prefix > DATE- 

     000100
     000200 01  DATE-MASTER-DATA.
     000300     05  DATE-DATE-INFO          PIC X(6).
     000400
     000500

     Module name for IMAGE-DATASET PRODUCT > PRODMOD 
     Element prefix > PRODUCT- 

     000100
     000200 01  PRODUCT-DATA.
     000300     05  PRODUCT-STOCK-NO        PIC X(8).
     000400     05  PRODUCT-DESCRIPTION     PIC X(20).
     000500
     000600

     Module name for IMAGE-DATASET SALES > SALESMOD 
     Element prefix > SALES- 

     000100
     000200 01  SALES-DATA.
     000300     05  SALES-ACCOUNT           PIC S9(9)  COMP.
     000400     05  SALES-STOCK-NO          PIC X(8).
     000500     05  SALES-QUANTITY          PIC S9(4)  COMP.
     000600     05  SALES-PRICE             PIC S9(9)  COMP.
     000700     05  SALES-TAX               PIC S9(9)  COMP.
     000800     05  SALES-TOTAL             PIC S9(9)  COMP.
     000900     05  SALES-PURCH-DATE        PIC X(6).
     001000     05  SALES-DELIV-DATE        PIC X(6).
     001100
     001200

     Module name for IMAGE-DATASET SUP-MASTER > SUPMOD 
     Element prefix > SUPPLY- 

     000100
     000200 01  SUP-MASTER-DATA.
     000300     05  SUPPLY-SUPPLIER         PIC X(16).
     000400     05  SUPPLY-STREET-ADDRESS   PIC X(26).
     000500     05  SUPPLY-CITY             PIC X(12).
     000600     05  SUPPLY-STATE            PIC X(2).
     000700     05  SUPPLY-ZIP              PIC X(6).
     000800
     000900

     Module name for IMAGE-DATASET INVENTORY > INVMOD 
     Element prefix > INVENT- 

     000100
     000200 01  INVENTORY-DATA.
     000300     05  INVENT-STOCK-NO         PIC X(8).
     000400     05  INVENT-ONHANDQTY        PIC S9(9)  COMP.
     000500     05  INVENT-SUPPLIER         PIC X(16).
     000600     05  INVENT-UNIT-COST        PIC S9(7)  COMP-3.
     000700     05  INVENT-LASTSHIPDAT      PIC X(6).
     000800     05  INVENT-BINNUM           PIC S9(2).
     000900
     001000

     Module name for STORE'S constants > CONSTMOD 

     000100
     000200 01  DB-STORE                    PIC X(8)  VALUE "  STORE ".
     000300 01  PWD-STORE                   PIC X(10)  VALUE "PASSWORD ".
     000400
     000500 01  DS-CUSTOMER                 PIC X(9)  VALUE "CUSTOMER ".
     000600 01  DS-DATE-MASTER              PIC X(12)  VALUE "DATE-MASTER ".
     000700 01  DS-PRODUCT                  PIC X(8)  VALUE "PRODUCT ".
     000800 01  DS-SALES                    PIC X(6)  VALUE "SALES ".
     000900 01  DS-SUP-MASTER               PIC X(11)  VALUE "SUP-MASTER ".
     001000 01  DS-INVENTORY                PIC X(10)  VALUE "INVENTORY ".
     001100
     001200 01  DI-ACCOUNT                  PIC X(8)  VALUE "ACCOUNT ".
     001300 01  DI-DATE-INFO                PIC X(11)  VALUE "DATE-INFO ".
     001400 01  DI-STOCK-NO                 PIC X(9)  VALUE "STOCK-NO ".
     001500 01  DI-PURCH-DATE               PIC X(11)  VALUE "PURCH-DATE ".
     001600 01  DI-DELIV-DATE               PIC X(11)  VALUE "DELIV-DATE ".
     001700 01  DI-SUPPLIER                 PIC X(9)  VALUE "SUPPLIER ".
     001800 01  DI-LASTSHIPDATE             PIC X(13)  VALUE "LASTSHIPDATE ".
     001900


MPE/iX 5.0 Documentation