Creating COBOL Names [ HP SYSTEM DICTIONARY XL COBOL DEFINITION EXTRACTOR Reference Manual ] MPE/iX 5.0 Documentation
HP SYSTEM DICTIONARY XL COBOL DEFINITION EXTRACTOR Reference Manual
Creating COBOL Names
SDCDE automatically prefixes or suffixes some COBOL data names. This
is in addition to the user-controlled prefixes, suffixes, and
qualifications. SDCDE does this for two reasons:
* Prefixes help identify the data item's usage. For example, because
the "DB-" prefix is always attached to the constants for database
names, you can easily identify constants of this kind.
* Sometimes one entity may generate a number of COBOL data names of
different usage. For example, a data set generates a COBOL record as
well as a constant for the data set name. In this case, a prefix or
suffix is necessary to create two distinct names.
Table 4-1 shows the prefixes and suffixes that SDCDE attaches to
different kinds of COBOL data names. Note that record names are
suffixed, and the constants are prefixed.
If an illegal COBOL character is found in an entity name, it is replaced
with a "-." Then, if the first or the last character of the name is a
"-," it is prefixed or suffixed with an "X-" or a "-X." If an entity name
is a COBOL reserved word, it is suffixed with an "-X" . When any of
these conditions occurs, SDCDE issues warning messages.
The maximum length for COBOL names in SDCDE is 61 characters. If a name
is longer than 61 characters, it is truncated.
Table 4-1. COBOL Prefixes and Suffixes
--------------------------------------------------------------------------------------------------
| | | | |
| Entity Type | COBOL Data Type | Prefix/ | Prefix/Suffix Name |
| | | Suffix | |
| | | | |
--------------------------------------------------------------------------------------------------
| | | | |
| IMAGE-DATABASE | Constant for DB name | Prefix | DB- |
| | Constant for DB password | Prefix | PWD- |
| | | | |
| IMAGE-DATASET | Record name | Suffix | -DATA |
| | Constant for DS name | Prefix | DS- |
| | Constant for search item | Prefix | DI- |
| | | | |
| FORMSFILE | Constant for FF name | Prefix | FF- |
| | Constant for FF lockword | Prefix | LWD- |
| | Constant for head form name | Prefix | HF- |
| | | | |
| FORM | Record name | Suffix | -DATA |
| | Constant for FORM name | Prefix | FORM- |
| | Record name for field #'s | Suffix | -FIELDS |
| | Constant for field # | Prefix | FIELDNO- |
| | | | |
| FILE | Record name | Suffix | -DATA |
| | Record name in FILE section | Suffix | -REC |
| | Constant for file name | Prefix | FILE- |
| | Constant for file lockword | Prefix | LWD- |
| | | | |
| KSAMFILE | Record name | Suffix | -DATA |
| | Record name in FILE section | Suffix | -REC |
| | Constant for KSAM file name | Prefix | KSAM- |
| | Constant for file lockword | Prefix | LWD- |
| | File table constant for KSAM | Suffix | -FILETAB |
| | | | |
| RECORD | Record name | Suffix | -DATA |
| | | | |
| ELEMENT | Record name | Suffix | -ELEM |
| | (If ELEMENT contains | | |
| | another ELEMENT) | | |
| | | | |
| HP-CONDITION-NAME | Condition name constant | Prefix | CN- |
| | | | |
--------------------------------------------------------------------------------------------------
Responses to SDCDE Prompts
At any SDCDE prompt, you can enter one of the following special
responses:
? Displays HELP messages associated with the current
prompt.
]] Returns to the command prompt.
] Moves you back to the previous prompt. If there is no
previous prompt, then the current prompt is reissued.
@ Causes SDCDE to respond as if you have entered
[[RETURN]] at all prompts following the current one.
^Y Equivalent to "]]" at prompts.
Alias Attribute Values
System Dictionary allows you to assign alias attribute values to any
entity or relationship. SDCDE recognizes a limited set of alias
attributes (cobol-alias, image-alias, standard-alias, and vplus-alias).
You can select one of these aliases with the ALIAS parameter of the
OPTIONS command. SDCDE only recognizes these aliases when you assign
them to entities of the types listed in Table 4-1 or assign them to
relationships of the type RECORD contains ELEMENT or ELEMENT contains
ELEMENT. When you assign an alias to an entity, SDCDE interprets the
alias as an alternate name for the entity, and uses the name in place of
the entity name in the generated source code. When you assign an alias
to a relationship, SDCDE interprets it as an alternate name for the
second entity in the relationship. If a given entity has two values for
the same alias attribute, one at the entity level and one at the
relationship level, the relationship level attribute takes precedence.
For example, suppose you have the relationship CUSTOMER-NAME contains
LAST-NAME of type ELEMENT contains ELEMENT. The LAST-NAME entity has a
cobol-alias value of LAST-NAME-ITEM, and the relationship has a
cobol-alias value of CUSTOMER-LAST-NAME. If the ALIAS parameter of the
OPTIONS command is set to COBOL, then SDCDE generates the CUSTOMER-NAME
item as follows:
01 CUSTOMER-NAME
05 CUSTOMER-LAST-NAME
Note that SDCDE uses the relationship level alias rather than the entity
level alias or the entity name.
MPE/iX 5.0 Documentation