Use the optional SAME AS clause in ELEMENT, FILE, MODULE, QFILE, PROCESS, PROGRAM, RECORD (REPORT) (TRANSACTION), SYSTEM (SUBSYSTEM), TABLE, and USER statements to reduce the amount of coding needed to define multiple entities of the same type.
SAME AS copies options associated with an existing entity occurrence into another entity occurrence. Except as noted in individual entity-type statements in Chapter 4, all options are copied.
Syntax: SAME AS Clause
┌────────────────────────────────────────────────────────────────────────── ►►─▼─ SAMe AS entity-type-name entity-occurrence-name ───────────────────────►─ ────────────────────────────────────────┐ ─►─┬────────────────────────────────────┬─┴───────────────────────────────────►◄ └─ Version is ─┬─ version-number ─┬──┘ ├─ HIGhest ────────┤ └─ LOWest ─────────┘
Parameters
Specifies the name of the object entity type; valid names are ELEMENT, FILE, MODULE, PROCESS, QFILE, TABLE, PROGRAM, RECORD, REPORT, TRANSACTION, SYSTEM, SUBSYSTEM, and USER.
Specifies the name of the entity-occurrence definition to be copied. The specified name must be the entity's primary name; it cannot be a synonym. DDDL makes sure that the entity occurrences specified (for the module, qfile, process, and table entities) are the same entity type.
Qualifies nonunique entity-occurrence names for the SAME AS clause.
Usage
Considerations for using SAME AS
The following considerations apply to using the SAME AS clause:
and
For example, assume you are starting with version 1 of the program PAYROLL. NEXT HIGHEST in the ADD PROGRAM statement (below) produces a version 2. The following SAME AS clause recalls the newly established version 2 (instead of the intended version 1), causing the error message ATTEMPTED RECURSIVE CONNECTION.
add program payroll version next highest
same as program payroll version highest.
Example
The following example adds the elements MODEL-DATE, PROMISE-DATE, and SHIP-DATE to the dictionary, copying the definition of MODEL-DATE for PROMISE-DATE and SHIP-DATE.
add element model-date
sub elements are
month
day
year.
add element promise-date
same as element model-date
comments 'items will be shipped before promise date'
-'when possible'.
add element ship-date
same as element model-date.
The DISPLAY statement lists the resulting definition for SHIP-DATE.
display element ship-date prep by j-user.
*+ add
*+ element name is ship-date
*+ date created is mm/dd/yy
*+ prepared by j-user
*+ subordinate elements are
*+ month version is 1
*+ day version is 1
*+ year version is 1
*+ .
|
Copyright © 2014 CA.
All rights reserved.
|
|