Generating FILE 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 FILE Definitions
If you specify FILE as the entity type in GENERATE command, SDCDE
generates a COBOL record definition for the file with the given entity
name.
If you set the SELECT-FILE parameter of the OPTIONS command to ON, SDCDE
issues prompts requesting the module name for the SELECT statement and
the FILE SECTION entry; otherwise SDCDE automatically skips the
SELECT/FILE SECTION generation.
Module name for FILE file-name's SELECT statement >
You can enter a module name or a [[RETURN]]. If you enter a [[RETURN]],
SDCDE does not generate any code for the SELECT statement. In either
case, SDCDE issues the following FILE SECTION prompt:
Module name for FILE file-name's FILE SECTION entry >
If you enter a [[RETURN]], SDCDE does not generate any code for the FILE
SECTION. If you enter a module name, SDCDE asks you whether to generate
the FD or SD:
Define the file-name in FILE SECTION as FD or SD (F/S) >
Respond with an F if you wish to generate an FD statement and an S if an
SD statement is desired. Note that a "relative" file must be a data file
(FD). Therefore, requesting an S for a relative file generates a warning
message.
In all cases, SDCDE issues a prompt for the copy library module name to
be assigned to the record layout and any constants generated for the file
in WORKING-STORAGE SECTION. The prompt has the following form:
Module name for FILE file-name's WORKING-STORAGE >
If you enter a [[RETURN]], the record layout is defined in the FILE
SECTION. If you do not enter a FILE SECTION module, a record layout is
not defined.
If you specify the ELEM-QUALIFY parameter of the OPTIONS command, and you
define a record layout in either the FILE SECTION or the WORKING-STORAGE
SECTION, 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 file. If you enter a [[RETURN]], SDCDE does not attach a prefix
or suffix.
When you complete the answers to these prompts, SDCDE generates the code
in the specified module or modules. If any 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 set the CONSTANTS parameter of the OPTIONS command to ON, and the
WORKING-STORAGE SECTION is generated, the filename and lockword constants
are generated in the WORKING-STORAGE SECTION. If you set the
SECONDARY-REC parameter of the OPTIONS command to OFF, only those records
that explicitly redefine the primary record, through a RECORD redefines
RECORD relationship, have definitions generated using the REDEFINES
clause. If you set the SECONDARY-REC parameter to ON, all records
explicitly redefining the primary record, as well as all secondary
records contained by the file, through a FILE contains RECORD
relationship, have definitions generated using the REDEFINES clause. If
you set the QUALIFY parameter to ON and the SECONDARY-REC parameter to
ON, then SDCDE prefixes all record names by the file name.
The SELECT statement uses the following attributes from the FILE entity
(unless otherwise specified) to complete the ASSIGN and ORGANIZATION
clauses:
lockword
file-dev-class
recording-mode
cctl-flag (from the FILE uses DEVICE-CLASS relationship)
file-size
file-type
The FD or SD statement uses the following attributes from the FILE
entity:
blocking-min
blocking-max
blocking-units
min-record-size
max-record-size
char-type
recording-format
The WORKING-STORAGE SECTION uses the lockword attribute from the FILE
entity.
Example 1
In the following example, the file name is ORDERF, SELECT-FILE = ON, and
ELEM-QUALIFY = PREFIX.
Module name for FILE ORDERF's SELECT statement > ORDERED
Module name for FILE ORDERF's FILE SECTION entry > ORDERFS
Define the ORDERF in FILE SECTION as FD or SD (F/S) > F
Module name for FILE ORDERF's WORKING-STORAGE > ORDERWS
Element prefix > [[RETURN]]
Module name is ORDERED
000100
000200 SELECT ORDERF
000300 ASSIGN "ORDERF/LOCK, DA, A, DISC(CCTL), 48"
000400 ORGANIZATION SEQUENTIAL.
000500
Module name is ORDERFS
000100
000200 FD ORDERF BLOCK 1 TO 5 RECORDS
000300 RECORDING MODE V
000400 RECORD 48 CHARACTERS
000500 CODE-SET ASCII.
000600
000700 01 ORDERF-REC PIC X(48).
000800
Module name is ORDERWS
000100
000200 01 ORDERF-DATA.
000300 05 ORD-CUST-ACCT PIC X(10).
000400 05 ORD-CUST-NAME PIC X(25).
000500 05 ORD-ORDER-NO PIC X(12).
000600 05 ORD-ORDER-STATUS PIC X.
000700
000800 01 FILE-ORDERF PIC X(8) VALUE "ORDERF ".
000900 01 LWD-ORDERF PIC X(8) VALUE "LOCK".
001000
Example 2
In the following example, the file name is ORDERF, SELECT-FILE = ON, and
ELEM-QUALIFY = PREFIX.
Module name for FILE ORDERF's SELECT statement > ORDERED
Module name for FILE ORDERF's FILE SECTION entry > ORDERFS
Define the ORDERF in FILE SECTION as FD or SD (F/S) > F
Module name for FILE ORDERF's WORKING-STORAGE > [[RETURN]]
Element prefix > [[RETURN]]
Module name is ORDERED
000100
000200 SELECT ORDERFR
000300 ASSIGN "ORDERF/LOCK, DA, A, DISC(CCTL), 48"
000400 ORGANIZATION SEQUENTIAL.
000500
Module name is ORDERFS
000100
000200 FD ORDERF BLOCK 1 TO 5 RECORDS
000300 RECORDING MODE V
000400 RECORD 48 CHARACTERS
000500 CODE-SET ASCII.
000600
000700
000800 01 ORDERF-DATA.
000900 05 ORD-CUST-ACCT PIC X(10).
001000 05 ORD-CUST-NAME PIC X(25).
001100 05 ORD-ORDER-NO PIC X(12).
001200 05 ORD-ORDER-STATUS PIC X.
001300
MPE/iX 5.0 Documentation