HP 3000 Manuals

EXAMPLES OF GENERATED CODE [ DICTIONARY 3000 ] MPE/iX 5.0 Documentation


DICTIONARY 3000

EXAMPLES OF GENERATED CODE 

The following provides a description and example of the COBOL source code
generated for the entities extracted from the Dictionary.

IMAGE Database Definitions 

DICTCDE allows you to generate the definition for an entire database or
for selected data sets.  The code generated for the database includes the
database name, the record layouts for all its related data sets, and the
constants containing the names of the search items.  The data set records
generated include the data set name and the associated data items.  The
data set name is generated as an 01-level identifier and the data items
are generated as 05-level identifiers.  Any child elements which are
related to those data items are generated as 10-level identifiers,
15-level identifiers, and so forth.

The IMAGE special parameters can also be generated for an IMAGE database.
These are the IMAGE special name-constant parameters that identify the
database, password, and search items which are used by the IMAGE
intrinsics.  The code generated for the IMAGE special parameters is shown
below:

Base parameter:

     000300 01  DB-SHPMGT               PIC X(9) VALUE "  SHPMGT"

Password parameter:

     000400 01  SHPMGT-PWD              PIC X(10) VALUE "         ".

The IMAGE standard parameters can also be generated for the database.
(See the discussion of Parameters under Examples of Generated Code for
more information.)

Note that all definitions for an IMAGE database are generated in
WORKING-STORAGE in the DATA DIVISION for a COBOL program.

Example 

The following is an example of the code generated for an IMAGE Database:

     000100
     000200 01  CUST-M-DATA.
     000300     05  DELETE-WORD        PIC X(2).
     000400     05  CUST-NUM           PIC S9(8).
     000500     05  CUST-NAME          PIC X(30).
     000600     05  CUST-STREET        PIC X(30).
     000700     05  CUST-CITY          PIC X(20).
     000800     05  CUST-STATE         PIC X(2).
     000900     05  CUST-ZIP           PIC S9(10).
     001000     05  CUST-PHONE         PIC X(12).
     001100     05  CUST-CREDIT-LIM    PIC S9(8).
     001200     05  CUST-BALANCE       PIC S9(10).
     001300
     001400 01  DS-CUST-M         PIC X(7) VALUE "CUST-M ".
     001500
     001600 01  DATE-A-DATA.
     001700     05  X-DATE        PIC X(8).
     001800
     001900 01  DS-DATE-A         PIC X(7) VALUE "DATE-A ".
     002000
     002100 01  INVOICE-M-DATA.
     002200     05  DELETE-WORD        PIC X(2).
     002300     05  INVOICE-NUM        PIC S9(8).
     002400
     002500 01  DS-INVOICE-M      PIC X(10) VALUE "INVOICE-M ".
     002600
     002700 01  ITEM-M-DATA
     002800     05  DELETE-WORD        PIC X(2).
     002900     05  ITEM-NUM           PIC S9(6).
     003000     05  ITEM-DESC          PIC X(30).
     003100     05  ITEM-UNIT-PRICE    PIC S9(8).
     003200     05  ITEM-QOH           PIC S9(6).
     003300     05  ITEM-ROP           PIC S9(6).
     003400
     003500 01  DS-ITEM-M         PIC X(7) VALUE "ITEM-M ".
     003600
     003700 01  INVOICE-D-DATA.
     003800     05  DELETE-WORD        PIC X(2).
     003900     05  INVOICE-NUM        PIC S9(8).
     004000     05  CUST-NUM           PIC S9(8).
     004100     05  INVOICE-TOTAL      PIC S9(10).
     004200     05  INVOICE-DATE       PIC X(8).
     004300
     004400 01  DS-INVOICE-D      PIC X(10) VALUE "INVOICE-D ".
     004500
     004600 01  LINE-ITEMS-D-DATA.
     004700     05  DELETE-WORD        PIC X(2).
     004800     05  INVOICE-NUM        PIC S9(8).
     004900     05  ITEM-NUM           PIC S9(6).
     005000     05  ITEM-QTY           PIC S9(6).
     005100     05  ITEM-SELL-PRICE    PIC S9(8).
     005200
     005300 01  DS-LINE-ITEMS-D    PIC X(13) VALUE "LINE-ITEMS-D  ".
     005400
     005500
     005600 01  DB-ORDERS          PIC X(9) VALUE  "  ORDERS  ".
     005700 01  ORDERS-PWD         PIC X(10) VALUE  ";        ".
     005800
     005900 01  DI-CUST-NUM        PIC X(9) VALUE  "CUST-NUM ".
     006000 01  DI-X-DATE          PIC X(5) VALUE  "DATE  ".
     006100 01  DI-INVOICE-NUM     PIC X(12) VALUE  "INVOICE-NUM ".
     006200 01  DI-ITEM-NUM        PIC X(9) VALUE  "ITEM-NUM ".
     006300 01  DI-INVOICE-DATE    PIC X(13) VALUE  "INVOICE-DATE  ".

IMAGE Data Set Definitions 

The code generated for an IMAGE data set includes the record layout of
the data set, a name which can be passed as the dset parameter to IMAGE,
and the names for the search items which can be passed as the item
parameter to DBFIND. If the alias option is enabled when the code is
generated, then any element that has an alias within the data set will be
generated with its alias.  Regardless of whether the alias option is
enabled or not, the respective VALUE clauses for the data set and search
items will use the aliases if they exist for those entities.

Example 

The following is an example of the code generated for a data set without
prefixes assigned:

     000100
     000200 01  CUST-M-DATA.
     000300     05  DELETE-WORD        PIC X(2).
     000400     05  CUST-NUM           PIC S9(8).
     000500     05  CUST-NAME          PIC X(30).
     000600     05  CUST-STREET        PIC X(30).
     000700     05  CUST-CITY          PIC X(20).
     000800     05  CUST-STATE         PIC X(2).
     000900     05  CUST-ZIP           PIC S9(10).
     001000     05  CUST-PHONE         PIC X(12).
     001100     05  CUST-CREDIT-LIM    PIC S9(8).
     001200     05  CUST-BALANCE       PIC S9(10).
     001300
     001400 01  DS-CUST-M         PIC X(7) VALUE "CUST-M ".
     001500 01  DI-CUST-NUM       PIC X(9) VALUE "CUST-NUM ".

The following is an example of the code generated for a data set with the
prefix "cm-" assigned:

     000100
     000200 01  CUST-M-DATA
     000300     05  CM-DELETE-WORD      PIC X(2).
     000400     05  CM-CUST-NUM         PIC S9(8).
     000500     05  CM-CUST-NAME        PIC X(30).
     000600     05  CM-CUST-STREET      PIC X(30).
     000700     05  CM-CUST-CITY        PIC X(20).
     000800     05  CM-CUST-STATE       PIC X(2).
     000900     05  CM-CUST-ZIP         PIC S9(10).
     001000     05  CM-CUST-PHONE       PIC X(12).
     001100     05  CM-CUST-CREDIT-LIM  PIC S9(8).
     001200     05  CM-CUST-BALANCE     PIC S9(10).
     001300
     001400 01  DS-CUST-M          PIC X(7) VALUE "CUST-M ".
     001500 01  DI-CM-CUST-NUM        PIC X(9) VALUE "CUST-NUM ".

VPLUS Forms File Definitions 

DICTCDE allows you to generate the definition for an entire forms file or
for selected forms.  The code generated for the forms file includes the
forms file name and the record layouts for all the related forms.  The
form records generated include the form name and their associated
elements.  The form name is generated as an 01-level identifier, and the
fields are generated as 05-level identifiers.  DICTCDE can also generate
field number tables for each form in the forms file.  (See the discussion
of VPLUS Forms Definition for an example of the field number tables
generated for a VPLUS form.)

The VPLUS standard parameters can also be generated for a forms file.
(See the discussion of Parameters under Examples of Generated Code for
more information.)

Example 

The following is an example of the code generated for a VPLUS forms file:

     000100
     000200 01  ADDCUST-DATA.
     000300     05  ACCOUNT                PIC X(10).
     000400     05  L-NAME                 PIC X(20).
     000500     05  F-NAME                 PIC X(18).
     000600     05  INITIAL                PIC X(1).
     000700     05  STREET-ADDR            PIC X(22).
     000800     05  CITY                   PIC X(14).
     000900     05  STATE                  PIC X(2).
     001000     05  ZIP-CODE               PIC X(5).
     001100     05  CREDIT                 PIC X(2).
     001200 01  ADDCUST-FIELDS.
     001300     05  ACCOUNT-FIELDNO        PIC S9(4) COMP VALUE 17.
     001400     05  L-NAME-FIELDNO         PIC S9(4) COMP VALUE 18.
     001500     05  F-NAME-FIELDNO         PIC S9(4) COMP VALUE 19.
     001600     05  INITIAL-FIELDNO        PIC S9(4) COMP VALUE 20.
     001700     05  STREET-ADDR-FIELDNO    PIC S9(4) COMP VALUE 21.
     001800     05  CITY-FIELDNO           PIC S9(4) COMP VALUE 22.
     001900     05  STATE-FIELDNO          PIC S9(4) COMP VALUE 5.
     002000     05  ZIP-CODE-FIELDNO       PIC S9(4) COMP VALUE 23.
     002100     05  CREDIT-FIELDNO         PIC S9(4) COMP VALUE 24.
     002200
     002300 01  ADDPROD-DATA.
     002400     05  PROD-NO                PIC X(8).
     002500     05  DESCRIPTION            PIC X(30).
     002600 01  ADDPROD-FIELDS
     002700     05  PROD-NO-FIELDNO        PIC S9(4) COMP VALUE 10.
     002800     05  DESCRIPTION-FIELDNO    PIC S9(4) COMP VALUE 11.
     002900
     003000 01  ADDSALE-DATA.
     003100     05  ACCOUNT                PIC X(10).
     003200     05  PROD-NO                PIC X(8).
     003300     05  QUANTITY               PIC 9(8).
     003400     05  PRICE                  PIC X(12).
     003500     05  TOTAL                  PIC X(12).
     003600     05  PURCH-DATE             PIC X(6).
     003700     05  DELIV-DATE             PIC X(6).
     003800     05  PURCH-NO               PIC X(6).
     003900 01 ADDSALE-FIELDS
     004000     05  ACCOUNT-FIELDNO        PIC S9(4) COMP VALUE 11.
     004100     05  PROD-NO-FIELDNO        PIC S9(4) COMP VALUE 12.
     004200     05  QUANTITY-FIELDNO       PIC S9(4) COMP VALUE 13.
     004300     05  PRICE-FIELDNO          PIC S9(4) COMP VALUE 14.
     004400     05  TOTAL-FIELDNO          PIC S9(4) COMP VALUE 15.
     004500     05  PURCH-DATE-FIELDNO     PIC S9(4) COMP VALUE 16.
     004600     05  DELIV-DATE-FIELDNO     PIC S9(4) COMP VALUE 17.
     004700     05  PURCH-NO-FIELDNO       PIC S9(4) COMP VALUE 18.
     004800
     004900 01  CHGCUST-DATA.
     005000     05  ACCOUNT                PIC X(10).
     005100     05  L-NAME                 PIC X(20).
     005200     05  F-NAME                 PIC X(18).
     005300     05  INITIAL                PIC X(1).
     005400     05  STREET-ADDR            PIC X(22).
     005500
     005600
     005700 01  ORDERSFF-CONST     PIC X(9) VALUE "ORDERSFF ".

VPLUS Form Definitions 

The code generated for a VPLUS form includes the record layout of the
form and the field number table for the fields in the form.  These tables
provide the field number for each field in a form.  (The field number is
useful in some VPLUS intrinsics such as VSETERROR.) Each field in the
form is represented by a data item in the table.  The data items are COMP
variables initialized to the field number value defined in the
Dictionary.  The following is an example of the field tables generated
for a VPLUS form:

     001100  01  DELSALE-FIELDS
     001200      05  ACCOUNT-FIELDNO        PIC S9(4) COMP VALUE 11.
     001300      05  PROD-NO-FIELDNO        PIC S9(4) COMP VALUE 12.
     001400      05  QUANTITY-FIELDNO       PIC S9(4) COMP VALUE 13.
     001500      05  PRICE-FIELDNO          PIC S9(4) COMP VALUE 14.
     001600      05  TOTAL-FIELDNO          PIC S9(4) COMP VALUE 15.
     001700      05  PURCH-DATE-FIELDNO     PIC S9(4) COMP VALUE 16.
     001800      05  DELIV-DATE-FIELDNO     PIC S9(4) COMP VALUE 17.
     001900      05  PURCH-NO-FIELDNO       PIC S9(4) COMP VALUE 18.
     002000

If the alias option is enabled when the code is generated for a form,
then any element that has an alias within that form will be generated
with its alias as the COBOL identifier for that element.

Example 

The following is an example of the code generated for a form:

     000100
     000200  01  DELSALE-DATA.
     000300      05  ACCOUNT                PIC X(10).
     000400      05  PROD-NO                PIC X(8).
     000500      05  QUANTITY               PIC 9(8).
     000600      05  PRICE                  PIC X(12).
     000700      05  TOTAL                  PIC X(12).
     000800      05  PURCH-DATE             PIC X(6).
     000900      05  DELIV-DATE             PIC X(6).
     001000      05  PURCH-NO               PIC X(6).
     001100  01  DELSALE-FIELDS
     001200      05  ACCOUNT-FIELDNO        PIC S9(4) COMP VALUE 11.
     001300      05  PROD-NO-FIELDNO        PIC S9(4) COMP VALUE 12.
     001400      05  QUANTITY-FIELDNO       PIC S9(4) COMP VALUE 13.
     001500      05  PRICE-FIELDNO          PIC S9(4) COMP VALUE 14.
     001600      05  TOTAL-FIELDNO          PIC S9(4) COMP VALUE 15.
     001700      05  PURCH-DATE-FIELDNO     PIC S9(4) COMP VALUE 16.
     001800      05  DELIV-DATE-FIELDNO     PIC S9(4) COMP VALUE 17.
     001900      05  PURCH-NO-FIELDNO       PIC S9(4) COMP VALUE 18.
     002000

MPE File Definitions 

DICTCDE allows you to generate source code for the ENVIRONMENT DIVISION
and DATA DIVISION for an MPE file.  For the ENVIRONMENT DIVISION portion,
DICTCDE generates the SELECT statement for an MPE file as follows:

     000100
     000200     SELECT CUSTMPE
     000300         ASSIGN "file-info"
     000400         ORGANIZATION IS SEQUENTIAL.

DICTCDE generates the SELECT statement for an MPER (MPE Relative) file as
follows:

     000100
     000200     SELECT CUSTMPER
     000300         ASSIGN "file-info"
     000400         ORGANIZATION IS RELATIVE

The file-info string contains the filename, CLASS, RECORDING MODE,
DEVICE, CCTL, and the FILE SIZE fields as they are defined in the
Dictionary.  Note that all these fields, except for DEVICE, are generated
only if they are defined in the Dictionary for that file.  If CCTL was
defined but DEVICE was not, then the DEVICE field would be generated as
LP. Otherwise, DICTCDE will generate DEVICE as it was defined in the
Dictionary.  If a file is related to a LOCATION in the Dictionary, then
the alias (if it is defined), and the group and account defined by the
LOCATION will be used for the file name field.

For the DATA DIVISION portion, DICTCDE generates an entry for the FILE
SECTION and the WORKING-STORAGE record.  The FILE SECTION for an MPE
sequential file can be generated as an FD file or as an SD file.  The
FILE SECTION for an MPER file can only be generated as an FD file.

The FILE SECTION is generated as follows:

     000100
     000200 FD  CUSTMPE
     000300     BLOCK CONTAINS block-size RECORDS
     000400     RECORD CONTAINS recsize CHARACTERS
     000500     CODE-SET IS alphabet-name 
     000600     RECORDING MODE IS recording-mode.

The above parameters are generated from the following entries defined in
the Dictionary for an MPE file:

block-size                BLOCKING(N/Y)?
                          UNIT(R/C)?
                          MINIMUM
                          MAXIMUM

recsize                   MINIMUM RECORD SIZE
                          MAXIMUM RECORD SIZE

alphabet-name             DATA STORAGE TYPE(A/E)?

recording-mode            RECORD FORMAT(F/V/U/S)?

Since the recsize parameter is generated from the RECSIZE entry in the
Dictionary, not from a total of the storage sizes of the elements in the
file, care should be taken when defining the file's record size in the
Dictionary.  Otherwise, the record size defined for the file may conflict
with the record layout of the file.  (Refer to Section 4, The DICTDBM
Commands, for more information on the above DICTDBM prompts.)

If any of the entries were not defined in the Dictionary for the above
parameters, the corresponding clause for those parameters will not be
generated.

The record layout of the file can be generated in the FD statement or in
WORKING-STORAGE. The record layout identifies the data items associated
with the file.  Each data item in the file is generated as an 05-level
identifier.  The child elements of those data items are generated as
10-level identifiers, 15-level identifiers and so forth.  If the alias
option is enabled when the code is generated, then any data item that has
an alias within the file will be generated with its alias as the COBOL
identifier.

When the record layout of the file is generated in the FILE SECTION, it
will immediately follow the FD Statement as shown below:

     000100
     000200 FD  CUSTMPE
     000300     RECORD CONTAINS 1023 CHARACTERS
     000400     RECORDING MODE IS S.
     000500
     000600 01  CUSTMPE-DATA.
     000700     05  CUST-NUM               PIC  S9(8).
     000800     05  CUST-CREDIT-LIM        PIC  S9(8).
     000900     05  CUST-BALANCE           PIC  S9(10).
     001000     05  INVOICE-NUM            PIC  S9(8).
     001100     05  INVOICE-TOTAL          PIC  S9(10).
     001200     05  INVOICE-DATE           PIC  X(8).
     001300     05  FILLER                 PIC  X(971).

When the record layout is generated in WORKING-STORAGE and no FD
Statement is generated, the code will be generated as shown below:

     000100
     000200 01  CUSTMPE-DATA.
     000300     05  CUST-NUM               PIC  S9(8).
     000400     05  CUST-CREDIT-LIM        PIC  S9(8).
     000500     05  CUST-BALANCE           PIC  S9(10).
     000600     05  INVOICE-NUM            PIC  S9(8).
     000700     05  INVOICE-TOTAL          PIC  S9(10).
     000800     05  INVOICE-DATE           PIC  X(8).
     000900     05  FILLER                 PIC  X(971).

When the record layout is generated in WORKING-STORAGE and the FD
Statement is also generated, the 01-level definition will appear in the
FD Statement to serve as a buffer for READs and WRITEs to the file.  The
generated code is shown below:

     000100
     000200 FD  CUSTMPE
     000300     RECORD CONTAINS 1023 CHARACTERS
     000400     RECORDING MODE IS S.
     000500 01  CUSTMPE-REC                PIC  X(1023).
     000100
     000200 01  CUSTMPE-DATA.
     000300     05  CUST-NUM               PIC  S9(8).
     000400     05  CUST-CREDIT-LIM        PIC  S9(8).
     000500     05  CUST-BALANCE           PIC  S9(10).
     000600     05  INVOICE-NUM            PIC  S9(8).
     000700     05  INVOICE-TOTAL          PIC  S9(10).
     000800     05  INVOICE-DATE           PIC  X(8).
     000900     05  FILLER                 PIC  X(971).

Note that the size generated for CUSTMPE-REC is derived from the
Dictionary definition for the record size of the file.  However, if the
record size of the file was not defined in the Dictionary, DICTCDE will
compute its size from the record layout size.  For a file with multiple
record formats, only the size of the primary record format will be used
in computing the file's record size.  Files with multiple record layouts
can also be generated by DICTCDE. If the record layout is to be generated
in the FD statement and the file has more than one record layout, DICTCDE
will use an implicit REDEFINES to define the multiple record layouts.
(In other words, DICTCDE lays out the multiple record layouts, one after
the other, which implicitly shows their relationship.)  Each record
layout will follow the other in the FD Statement as follows:

     000100
     000200 FD  CUSTMPE
     000300 01  CUSTMPE-DATA.
     000400     05  RECORD-LAYOUT-1   PIC X(80).
     000500 01  CUSTMPE-DATA2.
     000600     05  RECORD-LAYOUT-2-1 PIC X(40).
     000700     05  RECORD-LAYOUT-2-2 PIC X(40).

If the record layout is to be generated in WORKING-STORAGE and the file
has more than one record format, DICTCDE will use an explicit REDEFINES
to define the multiple record layouts.  (In other words, DICTCDE will use
the REDEFINES clause to show the relationship between the different
record layouts.)  The generated code for the FD Statement and for
WORKING-STORAGE is shown below:

     000100
     000200 FD  CUSTMPE
     000300 01  CUSTMPE-REC                PIC X(80).
     000100
     000200 01  CUSTMPE-DATA.
     000300     05  RECORD-LAYOUT-1        PIC X(80).
     000400 01  CUSTMPE-DATA2 REDEFINES CUSTMPE-DATA.
     000500     05  RECORD-LAYOUT-2-1      PIC X(40).
     000600     05  RECORD-LAYOUT-2-2      PIC X(40).

Example 

The following is an example of the code generated for an MPE file.  (Note
that the SELECT STATEMENT and FD statement have both been generated.  The
record layout has been generated in WORKING-STORAGE.)

     000100
     000200     SELECT CUSTMPE
     000300         ASSIGN "CUSTMPE,,,DISC"
     000400         ORGANIZATION IS SEQUENTIAL.
     000500
     000600 FD  CUSTMPE
     000700     RECORD CONTAINS 1023 CHARACTERS
     000800     RECORDING MODE IS S.
     000900 01  CUSTMPE-REC                PIC X(1023)
     001000
     001100 01  CUSTMPE-DATA.
     001200     05  CUST-NUM          PIC S9(8).
     001300     05  CUST-CREDIT-LIM   PIC S9(8).
     001400     05  CUST-BALANCE      PIC S9(10).
     001500     05  INVOICE-NUM       PIC S9(8).
     001600     05  INVOICE-TOTAL     PIC S9(10).
     001700     05  INVOICE-DATE      PIC X(8).
     001800     05  FILLER            PIC X(971).

KSAM File Definitions 

DICTCDE allows you to generate source code for the ENVIRONMENT DIVISION
and DATA DIVISION for a KSAM file.

For the ENVIRONMENT DIVISION portion, DICTCDE generates the SELECT
statement for a KSAM file as follows:

     000100
     000200     SELECT KORDER
     000300         ASSIGN "file-info"
     000400         ORGANIZATION IS INDEXED
     000500         RECORD KEY IS CUST-NUM
     000600         ALTERNATE RECORD KEY INVOICE-NUM
     000700         ALTERNATE RECORD KEY INVOICE-DATE WITH DUPLICATES.

The file-info string contains the filename and the FILE SIZE fields as
they are defined in the Dictionary.  Note that these fields are generated
only if they are defined in the Dictionary for that file.  If a file is
related to a LOCATION in the Dictionary, then the alias (if any), group,
and account defined by the LOCATION will be used for the file name field.
DICTCDE also generates the key clauses according to the definitions of
the items in the KSAM file.  For the DATA DIVISION portion, DICTCDE
generates an entry for the FILE SECTION and the WORKING-STORAGE record.

The FILE SECTION is generated as follows:

     000100
     000200 FD  KORDER
     000300     BLOCK CONTAINS block-size RECORDS
     000400     RECORD CONTAINS recsize CHARACTERS
     000500     RECORDING MODE IS recording-mode.

The above parameters are generated from the following entries defined in
the Dictionary for a KSAM file:

block-size                BLOCKING (N/Y)?
                          UNIT (R/C)?
                          MINIMUM
                          MAXIMUM

recsize                   MAXIMUM RECORD SIZE

recording-mode            RECORD FORMAT (F/V/U/S)?

Since the recsize parameter is generated from the entries in the
Dictionary, not from a total of the storage sizes of the elements in the
file, care should be taken when defining the file's record size in the
Dictionary.  Otherwise, the record size defined for the file may conflict
with the record layout of the file.  (Refer to Chapter 4, DICTDBM
Commands, for more information on the above DICTDBM prompts.)

If any of the entries were not defined in the Dictionary for the above
parameters, the corresponding clause for those parameters would not be
generated.

The record layout of the file can be generated in the FD statement or in
WORKING-STORAGE. The record layout identifies the data items associated
with the file.  Each data item in the file is generated as an 05-level
identifier.  The child elements of those data items are generated as
10-level identifiers, 15-level identifiers and so forth.  If the alias
option is enabled when the code is generated, then any data item that has
an alias within the file will be generated with its alias as the COBOL
identifier.

When the record layout of the file is generated in the FILE SECTION, it
will immediately follow the FD Statement as shown below:

     000100
     000200 FD  KORDER
     000300     RECORDING MODE IS F.
     000400
     000500 01  KORDER-DATA.
     000600     05  CUST-NUM               PIC  S9(8).
     000700     05  CUST-CREDIT-LIM        PIC  S9(8).
     000800     05  CUST-BALANCE           PIC  S9(10).
     000900     05  INVOICE-NUM            PIC  S9(8).
     001000     05  INVOICE-TOTAL          PIC  S9(10).
     001100     05  INVOICE-DATE           PIC  X(8).

When the record layout is generated in WORKING-STORAGE, and no copylib
module has been specified for the FD Statement, the code will be
generated as shown below:

     000100
     000200 01  KORDER-DATA.
     000300     05  CUST-NUM               PIC  S9(8).
     000400     05  CUST-CREDIT-LIM        PIC  S9(8).
     000500     05  CUST-BALANCE           PIC  S9(10).
     000600     05  INVOICE-NUM            PIC  S9(8).
     000700     05  INVOICE-TOTAL          PIC  S9(10).
     000800     05  INVOICE-DATE           PIC  X(8).

When the record layout is generated in WORKING-STORAGE, and the FD
Statement is also generated, the 01-level definition will appear in the
FD Statement to serve as a buffer for READs and WRITEs to the file.  The
generated code is shown below:

     000100
     000200 FD  KORDER
     000300     RECORDING MODE IS F.
     000400 01  KORDER-REC                PIC  X(52).
     000500
     000600 01  KORDER-DATA.
     000700     05  CUST-NUM               PIC  S9(8).
     000800     05  CUST-CREDIT-LIM        PIC  S9(8).
     000900     05  CUST-BALANCE           PIC  S9(10).
     001000     05  INVOICE-NUM            PIC  S9(8).
     001100     05  INVOICE-TOTAL          PIC  S9(10).
     001200     05  INVOICE-DATE           PIC  X(8).

This will only be of use when the file is being accessed by the KSAM
COBOL intrinsics.  If the file is defined in the SELECT Statement as
ORGANIZATION INDEXED, and the keys have been defined, then COBOL requires
that the record layout be generated in the FILE SECTION.

Note that the size generated for KORDER-REC is derived from the
Dictionary definition for the record size of the file.  However, if the
record size of the file was not defined in the Dictionary, DICTCDE will
compute its size from the record layout size.  For a file with multiple
record formats, only the size of the primary record format will be used
in computing the file's record size.

KSAM files with multiple record layouts can also be generated by DICTCDE.
If the record layout is to be generated in the FD statement, and the file
has more than one record layout, DICTCDE will use an implicit REDEFINES
to define the multiple record layouts.  Each record layout will follow
the other in the FD Statement as follows:

     000100
     000200 FD  KORDER
     000300 01  KORDER-DATA.
     000400     05  RECORD-LAYOUT-1   PIC X(80).
     000500 01  KORDER-DATA2.
     000600     05  RECORD-LAYOUT-2-1 PIC X(40).
     000700     05  RECORD-LAYOUT-2-2 PIC X(40).

Note that KORDER-DATA2 is defined in the Dictionary as a parent element
with 2 child elements.

If the record layout is to be generated in WORKING-STORAGE and the file
has more than one record format, DICTCDE will use an explicit REDEFINES
to define the multiple record layouts.  The generated code for the FD
Statement and for WORKING-STORAGE is shown below.

     000100
     000200 01  KORDER-DATA.
     000300     05  RECORD-LAYOUT-1        PIC X(80).
     000400 01  KORDER-DATA2 REDEFINES KORDER-DATA.
     000500     05  RECORD-LAYOUT-2-1      PIC X(40).
     000600     05  RECORD-LAYOUT-2-2      PIC X(40).

You can also generate the KSAM FILETABLE parameter along with the
WORKING-STORAGE record layout for the KSAM file.  The FILETABLE parameter
is the special parameter required by KSAM to be passed to each KSAM COBOL
intrinsic.  The following is an example of the FILETABLE parameter
generated for the file KORDER:

     000100
     000200 01  KORDER-FILETAB.
     000300     05  FILENUMBER             PIC S9(4) COMP VALUE 0.
     000400     05  FILENAME               PIC X(8) VALUE "KORDER".
     000500     05  I-O-TYPE               PIC S9(4) COMP VALUE 0.
     000600     05  A-MODE                 PIC S9(4) COMP VALUE 0.
     000700     05  PREV-OP                PIC S9(4) COMP VALUE 0.

DICTCDE will also generate the KSAM standard parameters.  The KSAM
standard parameters include a general FILETABLE parameter that does not
reference a file name and a STAT parameter that contains STATUS-KEY1 and
STATUS-KEY2 for use with the KSAM COBOL intrinsics.  The standard
FILETABLE can be used for any KSAM file as long as it is initialized
correctly.  The following is an example of the KSAM standard parameters:

     000100
     000200 01  FILETABLE.
     000300     05  FILENUMBER             PIC S9(4) COMP VALUE 0.
     000400     05  FILENAME               PIC X(8)       VALUE SPACES.
     000500     05  I-O-TYPE               PIC S9(4) COMP VALUE 0.
     000600     05  A-MODE                 PIC S9(4) COMP VALUE 0.
     000700     05  PREV-OP                PIC S9(4) COMP VALUE 0.
     000800 01  STAT.
     000900     05  STATUS-KEY-1           PIC X.
     001000     05  STATUS-KEY-2           PIC X.

Example 

The following is an example of the code generated for a KSAM file.  (Note
that the SELECT statement and FD statement have both been generated.)

     000100
     000200     SELECT KORDER
     000300         ASSIGN "KORDER"
     000400         ORGANIZATION IS INDEXED
     000500         RECORD KEY IS CUST-NUM
     000600         ALTERNATE RECORD KEY INVOICE-NUM
     000700         ALTERNATE RECORD KEY INVOICE-DATE WITH DUPLICATES.
     000800
     000900 FD  KORDER
     001000     RECORDING MODE IS F.
     001100 01  KORDER-DATA.
     001200     05  CUST-NUM          PIC S9(8).
     001300     05  CUST-CREDIT-LIM   PIC S9(8).
     001400     05  CUST-BALANCE      PIC S9(10).
     001500     05  INVOICE-NUM       PIC S9(8).
     001600     05  INVOICE-TOTAL     PIC S9(10).
     001700     05  INVOICE-DATE      PIC X(8).

Element Definitions 

DICTCDE allows you to generate source code for any data element defined
in the Dictionary.  The code is generated in WORKING-STORAGE. Each
element is generated as an 01-level data definition.  Any child elements
related to the element are generated as an 05-level identifier, 10-level
identifier and so forth.  If the alias option is enabled when the code is
generated, then any child element will be generated with its alias as its
COBOL identifier.

Example 

The following is an example of the code generated for an element with no
child elements:

     000200 01  CUST-NUM          PIC S9(8).

The next example shows the code generated for an element that has child
elements:

     000100
     000200 01  RECORD1.
     000300     05  FIELD1      PIC X(2).
     000400     05  FIELD2      PIC X(8).
     000500     05  FIELD3      PIC X(6).

Compound Element Definitions 

DICTCDE generates an array declaration for an element if its sub-element
count is defined in the Dictionary as greater than one.  Since arrays
cannot appear at the 01-level in COBOL, DICTCDE will generate an array as
an 05-level identifier, with a FILLER as an 01-level identifier.

For example, if an element is defined in the Dictionary as:

     ELEMENT        = PRICE
     ELEMENT-TYPE   = I
     ELEMENT-SIZE   = 2
     ELEMENT-LENGTH = 2
     ELEMENT-COUNT  = 10

the following code will be generated:

     000100
     000200 01  FILLER.
     000300     05  PRICE PIC S9(2) COMP OCCURS 10.

If the element is defined in the Dictionary as:

     ELEMENT         = ACCOUNT
     ELEMENT-TYPE    = P
     ELEMENT-SIZE    = 10
     ELEMENT-DECIMAL = 1
     ELEMENT-LENGTH  = 6
     ELEMENT-COUNT   = 4

the following code will be generated:

     000100
     000200 01  FILLER.
     000300     05  ACCOUNT PIC S9(8)V9(1) COMP-3 OCCURS 4.

Back-Referenced Elements 

DICTCDE generates a COBOL table for an element if its element type is
defined in the Dictionary as "*" .  (This element back references another
element.)  The element reference becomes the name of the sublevel of the
table.  For example, if the entity is defined in the Dictionary as:

     ELEMENT          = ACCOUNT
     ELEMENT-TYPE     = *
     ELEMENT-REFERENCE = ACCOUNT-MASTER
     ELEMENT-COUNT    = 10

and the back-referenced element ACCOUNT-MASTER is defined in the
Dictionary as:

     ELEMENT        = ACCOUNT-MASTER
     ELEMENT-TYPE   = X
     ELEMENT-SIZE   = 14
     ELEMENT-LENGTH = 14
     ELEMENT-COUNT  = 1

the following code is generated:

     000100
     000200 01  FILLER.
     000300     05  ACCOUNT OCCURS 10.
     000400         10  ACCOUNT-MASTER PIC X(14).

If both the element and the element reference have COUNTS greater than
one, a multi-dimensional table is generated.  For example, an element is
defined in the Dictionary as:

     ELEMENT           = ACCOUNT
     ELEMENT-TYPE      = *
     ELEMENT-REFERENCE = ACCOUNT-MASTER
     ELEMENT-COUNT     = 10

The back-referenced element ACCOUNT-MASTER is defined in the Dictionary
as:

     ELEMENT        = ACCOUNT-MASTER
     ELEMENT-TYPE   = X
     ELEMENT-SIZE   = 14
     ELEMENT-LENGTH = 14
     ELEMENT-COUNT  = 3

The code for ACCOUNT would be generated as follows:

     000100
     000200 01  FILLER.
     000300     05  ACCOUNT OCCURS 10.
     000400         10  ACCOUNT-MASTER PIC X(14) OCCURS 3.

The next example shows how DICTCDE generates code for an element that
back-references an element that has child elements related to it.  If an
element is defined in the Dictionary as:

     ELEMENT           = ACCOUNT
     ELEMENT-TYPE      = *
     ELEMENT-REFERENCE = ACCOUNT-MASTER
     ELEMENT-COUNT     = 10

and the back-referenced element ACCOUNT-MASTER has the elements NAME,
ADDRESS and COST related to it, then these elements are defined in the
Dictionary as:

     PARENT-ELEMENT = ACCOUNT-MASTER
     ELEMENT-TYPE   = X
     ELEMENT-SIZE   = 36
     ELEMENT-LENGTH = 36
     ELEMENT-COUNT  = 1

     CHILD-ELEMENTS        = NAME     ADDRESS     COST
     ELEMENT-TYPE          =  X          X         X
     ELEMENT-SIZE          =  9          2         5
     ELEMENT-LENGTH        =  9          2         5
     ELEMENT-COUNT         =  1          1         5
     ELEMENT-BYTE POSITION =  1         10        12

The code for the element ACCOUNT is generated as follows:

     000100
     000200 01  FILLER.
     000300     05  ACCOUNT OCCURS 10.
     000400         10  ACCOUNT-MASTER.
     000500             15  NAME    PIC X(9).
     000600             15  ADDRESS PIC X(2).
     000700             15  COST    PIC X(5) OCCURS 5.

In the above case, ACCOUNT-MASTER is generated only to include NAME,
ADDRESS, and COST as elements of table ACCOUNT.

Element to Element Relationships 

DICTCDE handles element-to-element relationships (child elements to
parent elements) differently depending on how the storage lengths and
byte positions are defined in the Dictionary for the child elements.  In
the first example, the storage length of the parent element (as defined
in the Dictionary) is equal to the sum of the storage lengths for the
child elements.  The byte positions for the child elements have been
defined in the Dictionary to allow the child elements to consecutively
follow each other within the parent element.  For this example, the
element SALES has the elements PRODUCT, PRICE and AMOUNT as child
elements.  The element SALES is defined in the Dictionary as:

     PARENT-ELEMENT = SALES
     ELEMENT-TYPE   = X
     ELEMENT-SIZE   = 50
     ELEMENT-LENGTH = 50

The child elements are defined in the Dictionary as:

     CHILD-ELEMENTS        = PRODUCT     PRICE     AMOUNT
     ELEMENT-TYPE          =    X          X          X
     ELEMENT-SIZE          =   12         28         10
     ELEMENT-LENGTH        =   12         28         10
     ELEMENT-BYTE POSITION =    1         13         41

The code for element SALES is generated as follows:

     000100
     000200 01  SALES.
     000300     05  PRODUCT PIC X(12).
     000400     05  PRICE   PIC X(28).
     000500     05  AMOUNT  PIC X(10).

Note that the COBOL record would be represented in storage as a memory
array of a length of 50 bytes, with PRODUCT being from byte 1 to 12,
PRICE from byte 13 to 40 and AMOUNT from byte 41 to 50.

In the next example of element-to-element relationships, the storage
length for the parent element is defined in the Dictionary.  The child
elements are defined at specified offsets defined in the Dictionary,
within the parent element's storage.  If there is a gap between the
memory areas of two consecutive child elements, DICTCDE generates FILLER
items in order to place the child elements at the proper offset within
the parent element and to assign the correct size to the parent element.
Therefore, when the parent element is accessed, the correct amount of
memory will be available for it.  Also, when the child element is
accessed, it will be at the correct offset within the parent.  For
example, the element ADDRESS has the elements STREET and YEARS related to
it.  The element ADDRESS is defined in the Dictionary as:

     PARENT-ELEMENT = ADDRESS
     ELEMENT-TYPE   = X
     ELEMENT-SIZE   = 48
     ELEMENT-LENGTH = 48

The child elements are defined in the Dictionary as:

     CHILD-ELEMENTS        = STREET     YEARS
     ELEMENT-TYPE          =   X          I
     ELEMENT-SIZE          =   12         5
     ELEMENT-LENGTH        =   12         4
     ELEMENT-BYTE POSITION =    4        30

Note that ADDRESS requires a storage length of 48 bytes.  Therefore, when
DICTCDE generates the code for ADDRESS, a FILLER is used at the end to
fill up the 48 bytes.

     000100
     000200 01  ADDRESS.
     000300     05  FILLER PIC X(3).
     000400     05  STREET PIC X(12).
     000500     05  FILLER PIC X(14).
     000600     05  YEARS  PIC S9(5) COMP.
     000700     05  FILLER PIC X(15).

Forced REDEFINES 

When the storage lengths and byte offsets for two child elements overlap
each other within the parent element, the two child elements cannot be
placed adjacently within the parent element record.  DICTCDE generates
these elements as a forced REDEFINES to insure they overlap exactly as
defined in the Dictionary.  For example, the element NAME has the child
elements F-NAME and M-NAME. The parent element NAME is defined in the
Dictionary as:

     ELEMENT        = NAME
     ELEMENT-TYPE   = X
     ELEMENT-SIZE   = 44
     ELEMENT-LENGTH = 44

The child elements are defined in the Dictionary as:

     CHILD-ELEMENTS        = F-NAME     M-NAME
     ELEMENT-TYPE          =    X          X
     ELEMENT-SIZE          =   28         12
     ELEMENT-LENGTH        =   28         12
     ELEMENT-BYTE POSITION =    1         12

The code for the element NAME would be generated as follows:

     000100
     000200 01  NAME.
     000300     05  F-NAME PIC X(28).
     000400     05  FILLER PIC X(16).
     000500 01  FILLER REDEFINES NAME.
     000600     05  FILLER PIC X(11).
     000700     05  M-NAME PIC X(12).
     000800     05  FILLER PIC X(21).

Explicit REDEFINES 

Overlapping child elements can also be generated by DICTCDE as explicit
REDEFINES as long as the record layout for the parent element was defined
in the Dictionary using the dummy element $REDEFINES. All child elements
added to the parent element's list of relationships before $REDEFINES
make up the first record layout.  When $REDEFINES is related to the
parent element, it implies that those child elements added to the
parent's list of relationships after the $REDEFINES dummy, constitute an
alternate record layout.

Note that when $REDEFINES is related to the parent element in DICTDBM, an
alias must be defined for $REDEFINES so that DICTCDE can use the alias as
the COBOL identifier for $REDEFINES. $REDEFINES can be related to the
file only once.  DICTCDE keeps track of the storage space of the first
record layout and correctly lays out the subsequent elements after the
$REDEFINES into alternate records, thus each alternate record format does
not exceed the storage space of the first record.  For example, the
element ELEM10 has the child elements ELEM2, ELEM3, ELEM7, $REDEFINES and
ELEM8 (in that order).  The parent element ELEM10 is defined in the
Dictionary as:

     ELEMENT              = ELEM10
     ELEMENT-TYPE         = X
     ELEMENT-SIZE         = 28
     ELEMENT-LENGTH       = 28

Suppose the child elements are defined in the Dictionary as:

     CHILD-ELEMENTS         = ELEM2     ELEM3    ELEM7    $REDEFINES     ELEM8
     ELEMENT-TYPE           =  X         I        X                       X
     ELEMENT-SIZE           = 12         5       28                      10
     ELEMENT-LENGTH         = 12         4       28                      10
     ELEMENT-BYTE POSITION  =  1        13        1                       1
     ELEMENT-ALIAS          =                             REDEFINE-REC

Note that if any of the above elements were not related to the parent
element in the correct order, you could change the order with the REORDER
command provided by DICTDBM.

The code for the element ELEM10 would be generated as follows:

     000100
     000200 01  ELEM10.
     000300     05  ELEM2      PIC X(12).
     000400     05  ELEM3      PIC S9(5) COMP.
     000500     05  FILLER     PIC X(12).
     000600 01  FILLER        REDEFINES ELEM10.
     000700     05  ELEM7      PIC X(28).
     000800 01  REDEFINE-REC  REDEFINES ELEM10.
     000900     05  ELEM8      PIC X(10).
     001000     05  FILLER     PIC X(18).

Edit Masks 

Display fields can be generated for elements defined with edit masks in
the Dictionary.  If the edit mask is enabled (see the Options response to
the main prompt), DICTCDE will generate a PICTURE clause for the edit
mask.  Table 7-1 shows how the edit masks are generated as COBOL PICTURE
characters.

          Table 7-1.  Edit Mask to COBOL PICTURE Clause Characters. 

--------------------------------------------------------------------------------------
|                       |                       |                                    |
|      Dictionary       |     COBOL PICTURE     |              Comments              |
|       Edit Mask       |   Clause Characters   |                                    |
|                       |                       |                                    |
--------------------------------------------------------------------------------------
|                       |                       |                                    |
| ^                     | X or 9                | X if data type is X or U,          |
|                       |                       | otherwise 9                        |
|                       |                       |                                    |
| , / $ * Z             | , / $ * Z             | These are valid COBOL characters   |
|                       |                       |                                    |
| .                     | .                     | Note that only one period may      |
|                       |                       | appear                             |
|                       |                       |                                    |
| (blank)               | B                     |                                    |
|                       |                       |                                    |
| CR                    | CR                    |                                    |
|                       |                       |                                    |
| DR                    | DR                    | COBOL only recognizes DB.          |
|                       |                       |                                    |
| !                     | ERROR                 | COBOL does not have an equivalent  |
|                       |                       |                                    |
| Any other             | ERROR                 | No other characters are allowed    |
|                       |                       |                                    |
--------------------------------------------------------------------------------------

When code is generated for elements with edit masks, the display size for
the elements is generated according to the display size defined in the
Dictionary.  However, the storage length is changed when code is
generated for edit masks.  For entities which contain child elements with
edit masks, the record layout for the parent entity is also changed.
Therefore, the byte offsets for the elements with edit masks must be
defined in the Dictionary according to the edit mask size, not by the
data storage requirements.  (This may require changes to the existing
definitions in the Dictionary.)

When defining a parent element or file with edit masks in the Dictionary,
you should manually define the byte offsets for that entity in the
Dictionary according to the COBOL storage lengths for their edit masks.
Otherwise, the child elements will probably overlap each other.  To
compute the required storage length, add one byte for each COBOL PICTURE
clause character.  The storage length of the parent element should also
be defined as the total storage lengths of the child elements with their
edit masks, to ensure that the child elements all fit within the record
layout.

In the next table, the parent element PART-MASTER has the child elements
PART1, PART2, PART3, PART4, PART5, and PART6 related to it.  Table 7-2
shows the edit masks and the correct byte offsets as defined in the
Dictionary for the child elements and the COBOL PICTURE clause generated
for those elements.

          Table 7-2.  Generating COBOL PICTURE Clauses. 

------------------------------------------------------------------------------------
|          |                       |          |                                    |
| ELEMENT  |       EDIT MASK       |  BYTE/   |        COBOL PICTURE Clause        |
|          |                       | POSITION |                                    |
|          |                       |          |                                    |
------------------------------------------------------------------------------------
|          |                       |          |                                    |
| Part1    | ^^^^^^/^^^^^^/^^      | 1        | 05 PART1 PIC XXXXXX/XXXXXX/XX.     |
|          |                       |          |                                    |
| Part2    | ^^^ ^^^ ^^^^          | 17       | 05 PART2 PIC XXXBXXXBXXXX.         |
|          |                       |          |                                    |
| Part3    | $$$,$$$,$$$.^^        | 29       | 05 PART3 PIC $$$,$$$,$$$.99.       |
|          |                       |          |                                    |
| Part4    | ZZZ,ZZZ.^^            | 43       | 05 PART4 PIC ZZZ,ZZZ.99.           |
|          |                       |          |                                    |
| Part5    | ^^,^^^.^^CR           | 53       | 05 PART5 PIC 99,999.99CR.          |
|          |                       |          |                                    |
| Part6    | ^^,^^^.^^DR           | 64       | 05 PART6 PIC 99,999.99DB           |
|          |                       |          |                                    |
------------------------------------------------------------------------------------

Code Generated for Standard Parameters 

DICTCDE also generates source code for the IMAGE, VPLUS and KSAM standard
parameters.  (To generate these standard parameters, see the Parameter
response to the main prompt issued by DICTCDE.)

The IMAGE standard parameters include the DB STATUS array declaration,
the eight MODE declarations, and the utility LIST declarations.  The
IMAGE parameters are generated in the WORKING-STORAGE record as follows:

     000100
     000200 01  STATUS.
     000300     05  C-WORD             PIC S9(4) COMP.
     000400     05  STAT2              PIC S9(4) COMP.
     000500     05  STAT3-4            PIC S9(9) COMP.
     000600     05  STAT5-6            PIC S9(9) COMP.
     000700     05  STAT7-8            PIC S9(9) COMP.
     000800     05  STAT9-10           PIC S9(9) COMP.
     000900 01  DUMMY-LIST             PIC X(2) VALUE "; ".
     001000 01  ALL-ITEMS              PIC X(2) VALUE "@;".
     001100 01  PREVIOUS-LIST          PIC X(2) VALUE "*;".
     001200 01  MODE1                  PIC 9999 COMP VALUE 1.
     001300 01  MODE2                  PIC 9999 COMP VALUE 2.
     001400 01  MODE3                  PIC 9999 COMP VALUE 3.
     001500 01  MODE4                  PIC 9999 COMP VALUE 4.
     001600 01  MODE5                  PIC 9999 COMP VALUE 5.
     001700 01  MODE6                  PIC 9999 COMP VALUE 6.
     001800 01  MODE7                  PIC 9999 COMP VALUE 7.
     001900 01  MODE8                  PIC 9999 COMP VALUE 8.

The VPLUS standard parameters include the VPLUS COMAREA definition and a
character string which identifies the terminal.  (The terminal ID is used
for passing to VOPENTERM.) The VPLUS parameters are generated to the
WORKING-STORAGE record as follows:

     001800
     001900 01  COMAREA.
     002000     05  COM-STATUS         PIC S9(4)  COMP VALUE 0.
     002100     05  COM-LANGUAGE       PIC S9(4)  COMP VALUE 0.
     002200     05  COM-COMAREALEN     PIC S9(4)  COMP VALUE 60.
     002300     05  FILLER             PIC S9(4)  COMP VALUE 0.
     002400     05  COM-MODE           PIC S9(4)  COMP VALUE 0.
     002500     05  COM-LASTKEY        PIC S9(4)  COMP VALUE 0.
     002600     05  COM-NUMERRS        PIC S9(4)  COMP VALUE 0.
     002700     05  FILLER             PIC S9(4)  COMP VALUE 0.
     002800     05  FILLER             PIC S9(4)  COMP VALUE 0.
     002900     05  FILLER             PIC S9(4)  COMP VALUE 0.
     003000     05  COM-CFNAME         PIC X(15)       VALUE SPACES.
     003100     05  FILLER             PIC X(1)        VALUE SPACES.
     003200     05  COM-NFNAME         PIC X(15)       VALUE SPACES.
     003300     05  FILLER             PIC X(1)        VALUE SPACES.
     003400     05  COM-REPEATOPT      PIC S9(4)  COMP VALUE 0.
     003500     05  COM-NFOPT          PIC S9(4)  COMP VALUE 0.
     003600     05  FILLER             PIC S9(4)  COMP VALUE 0.
     003700     05  COM-DBUFLEN        PIC S9(4)  COMP VALUE 0.
     003800     05  FILLER             PIC S9(4)  COMP VALUE 0.
     003900     05  FILLER             PIC S9(4)  COMP VALUE 0.
     004000     05  COM-DELETEFLAG     PIC S9(4)  COMP VALUE 0.
     004100     05  COM-SHOWCONTROL    PIC S9(4)  COMP VALUE 0.
     004200     05  FILLER             PIC S9(4)  COMP VALUE 0.
     004300     05  FILLER             PIC S9(4)  COMP VALUE 0.
     004400     05  FILLER             PIC S9(4)  COMP VALUE 0.
     004500     05  FILLER             PIC S9(4)  COMP VALUE 0.
     004600     05  FILLER             PIC S9(4)  COMP VALUE 0.
     004700     05  FILLER             PIC S9(4)  COMP VALUE 0.
     004800     05  FILLER             PIC S9(4)  COMP VALUE 0.
     004900     05  FILLER             PIC S9(4)  COMP VALUE 0.
     005000     05  COM-NUMRECS        PIC S9(9)  COMP VALUE 0.
     005100     05  COM-RECNUM         PIC S9(9)  COMP VALUE 0.
     005200     05  FILLER             PIC S9(4)  COMP VALUE 0
     005300     05  FILLER             PIC S9(4)  COMP VALUE 0.
     005400     05  COM-TERMFILENUM    PIC S9(4)  COMP VALUE 0.
     005500     05  FILLER             PIC S9(4)  COMP VALUE 0.
     005600     05  FILLER             PIC S9(4)  COMP VALUE 0.
     005700     05  FILLER             PIC S9(4)  COMP VALUE 0.
     005800     05  FILLER             PIC S9(4)  COMP VALUE 0.
     005900     05  FILLER             PIC S9(4)  COMP VALUE 0.
     006000     05  FILLER             PIC S9(4)  COMP VALUE 0.
     006100     05  COM-TERMOPTIONS    PIC S9(4)  COMP VALUE 0
     006200     05  FILLER             PIC S9(4)  COMP VALUE 0.
     006300     05  FILLER             PIC S9(4)  COMP VALUE 0.
     006400     05  FILLER             PIC S9(4)  COMP VALUE 0.
     006500     05  FILLER             PIC S9(4)  COMP VALUE 0.
     006600 01  TERMFILENAME           PIC X(6)        VALUE "TERM  ".
     006700 01  MESSAGE-BUF            PIC X(72)       VALUE SPACES.
     006800 01  MESSAGE-BUF-LEN        PIC S9(4)  COMP VALUE 72.
     006900 01  MSGLEN                 PIC S9(4)  COMP VALUE 0.
     007000 01  FIELDNUM               PIC S9(4)  COMP VALUE 0.
     007100 01  BUFLEN                 PIC S9(4)  COMP VALUE 0.

The KSAM standard parameters include a general KSAM FILETABLE which does
not reference any particular file and the STAT parameters.  The general
KSAM FILETABLE can be used for any file as long as it is initialized
correctly.  The STAT parameters contain STATUS-KEY1 and STATUS-KEY2 which
can be used by the KSAM COBOL intrinsics.  The KSAM parameters are
generated to WORKING-STORAGE as follows:

     007300 01  FILETABLE.
     007400     05  FILENUMBER         PIC S9(4)  COMP VALUE 0.
     007500     05  FILENAME           PIC X(8)        VALUE SPACES.
     007600     05  I-O-TYPE           PIC S9(4)  COMP VALUE 0.
     007700     05  A-MODE             PIC S9(4)  COMP VALUE 0.
     007800     05  PREV-OP            PIC S9(4)  COMP VALUE 0.
     007900 01  STAT.
     008000     05  STATUS-KEY-1       PIC X.
     008100     05  STATUS-KEY-2       PIC X.


MPE/iX 5.0 Documentation