Previous Topic: DESTINATIONNext Topic: ELEMENT SYNONYM


ELEMENT

ELEMENT statements are used to define group or elementary data elements. Also known as fields and data items, elements can participate in records built by the DDDL compiler, by the CA IDMS schema compiler, or in maps built by the DC/UCF mapping compiler; elements can also exist independently in the dictionary. An element can have a maximum length of 32,767 characters.

Optional ELEMENT statement clauses allow the user to:

Defining Group Element Occurrences

The user defines and maintains group element occurrences by means of SUBORDINATE ELEMENT clauses, which provide one method for documenting multiply-occurring or redefined elements/groups in the dictionary.

Modifying an Element Definition

When the user modifies an element definition, the DDDL compiler does not modify the definitions of records in which the named element participates. Record elements must be modified individually by using the RECORD ELEMENT substatement, described under RECORD (REPORT/TRANSACTION) later in this chapter.

Deleting Element Occurrences

The user cannot delete element occurrences that are members of a group element structure or that participate in IDD- or schema-built records. To delete an elementary element, the user must first disassociate it from the group element; to delete a record element, the user must first delete its associated record or schema. To prevent the deletion of an element when the only record in which it participates is deleted, select the SET OPTIONS statement DELETE IS OFF option for the session; see SET OPTIONS Statement for further details.

Required Authority

If the SET OPTIONS statement specifies SECURITY FOR IDD IS ON, the user must be assigned the proper authority to issue ELEMENT statements.

Syntax

ELEMENT Statement

►►─┬─ ADD ─────┬─ ELement name is element-name ───────────────────────────────►
   ├─ MODify ──┤
   ├─ REPlace ─┤
   └─ DELete ──┘

 ►─┬───────────────────────────────────────────┬──────────────────────────────►
   └─ Version is ─┬─ version-number ─────────┬─┘
                  └─┬────────┬─┬─ HIGhest ─┬─┘
                    └─ NEXt ─┘ └─ LOWest ──┘

 ►─┬────────────────────────────────────────────────────────┬─────────────────►
   └─┬─ PREpared ─┬─ by user-id  ┬────────────────────────┬─┘
     └─ REVised ──┘              └─ PASsword is password ─┘
   ┌────────────────────────────────────────────────────────────────────────┐
 ►─▼─┬────────────────────────────────────────────────────────────────────┬─┴─►
     └─ SAMe AS ELement element-name ─┬──────────────────────────────────┬┘
                                      └─ Version is ─┬─ version-number ─┬┘
                                                     ├─ HIGhest ────────┤
                                                     └─ LOWest ─────────┘

   ┌──────────────────────────────────────────────────────────────────────────
 ►─▼─┬────────────────────────────────────────────────────────────────────────►─
     └─ COPy ─┬─ ELements ──────────┬─ FROm element element-name ─────────────
              ├─ ALL COMment TYPes ─┤
              ├─ ATTributes ────────┤
              ├─ USErs ─────────────┤
              ├─ COMments ──────────┤
              ├─ DEFinition ────────┤
              ├─ VALues ────────────┤
              ├─ RANges ────────────┤
              ├─ comment-key ───────┤
              └─ relational-key ────┘
  ─────────────────────────────────────────┐
─►───────────────────────────────────────┬─┴──────────────────────────────────►
  ───┬─────────────────────────────────┬─┘
     └─ Version is ─┬─ version-number ─┤
                    ├─ HIGhest ────────┤
                    └─ LOWest ─────────┘

 ►─┬────────────────────────────────────────────────────────────────────────┬─►
   └─ NEW NAMe is new-element-name ──┬─────────────────────────────────────┬┘
                                     └─ Version is ─┬─ version-number ─────┤
                                                    └─ NEXt ─┬─ HIGhest ─┬─┘
                                                             └─ LOWest ──┘

 ►─┬───────────────────────────────────────────┬──────────────────────────────►
   └─ NEW Version is ─┬─ new-version-number ─┬─┘
                      └─ NEXt ─┬─ HIGhest ─┬─┘
                               └─ LOWest ──┘
 ►─┬────────────────────────────────────────────┬─────────────────────────────►
   └─ element DEScription is description-text ──┘

   ┌─────────────────────────────────────────────────────────────────┐
 ►─▼─┬─────────────────────────────────────────────────────────────┬─┴────────►
     └─┬─ INClude ◄ ─┬─ USEr is user-id ──┬──────────────────────┬─┘
       └─ EXClude ───┘                    └─ user-specification ─┘

(for complete user-specification syntax, see USER clause)

 ►─┬──────────────────────────────────────────────────────┬───────────────────►
   └─ PUBlic access is ─┬───────────┬─ for ─┬─ ALL ◄ ───┬─┘
                        └─ ALLOwed ─┘       ├─ NONe ────┤
                                            ├─ UPDate ──┤
                                            ├─ MODify ──┤
                                            ├─ REPlace ─┤
                                            ├─ DELete ──┤
                                            └─ DISplay ─┘
   ┌──────────────────────────────────────────────────────────────────────────
 ►─▼─┬────────────────────────────────────────────────────────────────────────►─
     └─┬─ INClude ◄ ─┬─ VALues ─┬─ is ──┬─────────────────────────────────────
       └─ EXClude ───┘          └─ are ─┘

────────────────────────────────────────────────────────────────────────────
─►────────────────────────────────────────────────────────────────────────────►─
            ┌─────────────────────────────────────────────────────────────────
  ─┬─────┬──▼─┬───────┬─┬─ initial-value ───┬─────────────────────────────────
   └─ ( ─┘    └─ ALL ─┘ └─ condition-value ─┘

  ────────────────────────────────────────────────────┐
─►──────────────────────────────────────────────────┬─┴───────────────────────►
  ────────────────────────────────────────┐         │
  ─┬────────────────────────────────────┬─┴─┬─────┬─┘
   └─ THRu ─┬───────┬─ condition-value ─┘   └─ ) ─┘
            └─ ALL ─┘
 ►─┬───────────────────────┬──────────────────────────────────────────────────►
   └─ EXClude ALL VALUES ──┘

   ┌──────────────────────────────────────────────────────────────────┐
 ►─▼─┬─────────────────────────────────────────────────────────────┬──┴───────►
     └─┬─ INClude ◄ ─┬─ RANge is start-value ─┬──────────────────┬─┘
       └─ EXClude ───┘                        └─ THRu end-value ─┘

 ►─┬───────────────────────┬──────────────────────────────────────────────────►
   └─ EXClude ALL RANGES ──┘
   ┌─────────────────────────────────────────────────────────────────┐
 ►─▼─┬─────────────────────────────────────────────────────────────┬─┴────────►
     └─┬─ PRimary ◄ ────────────────┬──┬─────────────────────────┬─┘
       └─ alternate-format-keyword ─┘  └─ format-specification ──┘

(expanded format-specification syntax follows this syntax diagram)

   ┌──────────────────────────────────────────────────────────────────────────
 ►─▼─┬────────────────────────────────────────────────────────────────────────►─
     └─┬─ INClude ◄ ─┬─ ELement name SYNonym is element-synonym-name ───────────
       └─ EXClude ───┘

  ────────────────────────────────────────────────┐
─►──────────────────────────────────────────────┬─┴───────────────────────────►
  ─┬─────────────────────────────────────────┬──┘
   └─ FOR GROup synonym group-synonym-name ──┘
   ┌────────────────────────────────────────────────────────────────────────┐
 ►─▼─┬────────────────────────────────────────────────────────────────────┬─┴─►
     └─┬─ INClude ◄ ─┬ class-name is attribute-name ┬───────────────────┬─┘
       └─ EXClude ───┘                              └ TEXt is user-text ┘

   ┌──────────────────────────────────────────────────────────────────────────
 ►─▼─┬────────────────────────────────────────────────────────────────────────►─
     └─┬─ INClude ◄ ─┬── relational-key is element-name ──────────────────────
       └─ EXClude ───┘

  ───────────────────────────────────────────────────────────────────┐
─►─────────────────────────────────────────────────────────────────┬─┴────────►
  ─┬───────────────────────────────────┬──┬──────────────────────┬─┘
   └─ Version is ─┬─ version-number ─┬─┘  └─ TEXt is user-text ──┘
                  ├─ HIGhest ────────┤
                  └─ LOWest ─────────┘
   ┌───────────────────────────────────────────────────────────────┐
 ►─▼─┬───────────────────────────────────────────────────────────┬─┴──────────►
     │                            ┌────────────────────┐         │
     └─ EDIt ─┬─ COMments ────┬───▼─ edit-instruction ─┴─ QUIT ──┘
              ├─ DEFinition ──┤
              └─ comment-key ─┘

   ┌──────────────────────────────────────────────────┐
 ►─▼─┬─────────────────────────────────────────────┬──┴───────────────────────►◄
     └─┬─ COMments ─────┬── is ─┬─ NULl ─────────┬─┘
       ├─ DEFinition ───┤       └─ comment-text ─┘
       └─ comment-key ──┘

Expansion of format-specification

►►─┬────────────────────────────┬─────────────────────────────────────────────►
   └─ PICture is ─┬─ NULl ◄ ──┬─┘
                  └─ picture ─┘

 ►─┬────────────────────────────┬─────────────────────────────────────────────►
   └─ USAge is ─┬─ DISplay ◄ ─┬─┘
                └─ usage ─────┘

 ►─┬──────────────────────────┬───────────────────────────────────────────────►
   └─ JUStify is ─┬─ OFF ◄ ─┬─┘
                  └─ ON ────┘

 ►─┬──────────────────────────────────┬───────────────────────────────────────►
   └─ BLAnk when ZERo is ─┬─ OFF ◄ ─┬─┘
                          └─ ON ────┘
 ►─┬───────────────────────────────────────────────────────┬──────────────────►
   └─ SIGn is ─┬─ NULl ◄ ────────────────────────────────┬─┘
               └─┬─ LEAding ──┬─┬──────────────────────┬─┘
                 └─ TRAiling ─┘ └─ SEParate character ─┘

 ►─┬─────────────────┬────────────────────────────────────────────────────────►
   └─┬─ SYNc ──────┬─┘
     └─ NO SYNc ◄ ─┘

 ►─┬─────────────────────────────────┬────────────────────────────────────────►
   └─ EXClude SUBordinate ELements ──┘
 ►─┬──────────────────────────────────────────────────────────────────────────►─
   │                                  ┌───────────────────────────────────────
   └─ SUBordinate elements are ─┬───┬─▼── subordinate-element-name ───────────
                                └ ( ┘

─►────────────────────────────────────────────────────────────────────────┬───►◄
  ──────────────────────────────────────────────────────────────────┐     │
  ─┬────────────────────────────────┬┬─────────────────────────────┬┴┬───┬┘
   └ Version is ┬─ version-number ─┬┘└┬ OCCurs occurrence-count ─┬─┘ └ ) ┘
                ├─ HIGhest ────────┤  └ (R) ─────────────────────┘
                └─ LOWest ─────────┘

DISPLAY/PUNCH ELEMENT Statement (for a single element)

►►─┬─ DISplay ─┬─ ELement name is element-name ───────────────────────────────►
   └─ PUNch ───┘

 ►─┬───────────────────────────────────────────────────┬──────────────────────►
   └─ PREpared by user-id ─┬─────────────────────────┬─┘
                           └─ PASsword is password ──┘
   ┌───────────────────────────────────────────────────────────┐
 ►─▼─┬───────────────────────────────────────────────────────┬─┴──────────────►
     │                 ┌───────────────────────────────────┐ │
     └─┬─ WITh ──────┬─▼──┬─ ALL ───────────────────────┬──┴─┘
       ├─ ALSo WITh ─┤    ├─ ALL COMment TYPes ─────────┤
       └─ WITHOut ───┘    ├─ ATTributes ────────────────┤
                          ├─ COMments ──────────────────┤
                          ├─ DEFinitions ───────────────┤
                          ├─ DETails ───────────────────┤
                          ├─ ELements ──────────────────┤
                          ├─ HIStory ───────────────────┤
                          ├─ MAPs ──────────────────────┤
                          ├─ NONE ──────────────────────┤
                          ├─ PROgrams ──────────────────┤
                          ├─ SAMe AS ───────────────────┤
                          ├─ SUBordinate ELements ──────┤
                          ├─ SYNonyms ──────────────────┤
                          ├─ USErs ─────────────────────┤
                          ├─┬─ USEr DEFINED COMments ─┬─┤
                          │ └─ UDCs ──────────────────┘ │
                          ├─┬─ USEr DEFINED NESts ─┬────┤
                          │ └─ UDNS ───────────────┘    │
                          └─ WHEre USED ────────────────┘
 ►─┬──────────────────────────────────────────────────────────────────────────►─
   └─ TO ─┬─ SYSpch ──────────────────────────────────────────────────────────
          └─ MODule module-name ─┬───────────────────────────────────┬────────
                                 └─ Version is ─┬─ version-number ─┬─┘
                                                ├─ HIGhest ────────┤
                                                └─ LOWest ─────────┘

─►──────────────────────────────────────────────────────────────────────────┬─►
  ─────────────────────────────────────────────────────────────────────────┬┘
  ─┬──────────────────────┬┬──────────────────────────────────────────────┬┘
   └ LANguage is language ┘└ PREpared by user-id ┬───────────────────────┬┘
                                                 └ PASsword is password ─┘

 ►─┬──────────────────────┬──┬─────────────────────┬──────────────────────────►◄
   └─ VERB ─┬─ DISplay ─┬─┘  └─ AS ─┬─ SYNtax ───┬─┘
            ├─ PUNch ───┤           └─ COMments ─┘
            ├─ ADD ─────┤
            ├─ MODify ──┤
            ├─ REPlace ─┤
            └─ DELete ──┘

DISPLAY/PUNCH ELEMENT Statement (for multiple elements)

►►─┬─ DISplay ─┬─┬─ ALL ──────────────────────────┬─ ELEments ────────────────►
   └─ PUNch ───┘ └─┬─ FIRst ─┬─┬─ 1 ◄ ──────────┬─┘
                   ├─ NEXt ──┤ └─ entity-count ─┘
                   ├─ LASt ──┤
                   └─ PRIor ─┘

 ►─┬──────────────────────────────────────────────────┬───────────────────────►
   └─ PREpared by user-id ─┬────────────────────────┬─┘
                           └─ PASsword is password ─┘

 ►─┬─────────────────────────────────┬────────────────────────────────────────►
   └─ WHEre conditional-expression ──┘

(for complete conditional-expression syntax, see WHERE clause)

 ►─┬───────────────────┬──────────────────────────────────────────────────────►
   └─ BY ─┬─ SET ────┬─┘
          └─ AREa ◄ ─┘
 ►─┬──────────────────────────────────────────────────────────────────────────►─
   └─ TO ─┬─ SYSpch ──────────────────────────────────────────────────────────
          └─ MODule module-name ─┬───────────────────────────────────┬────────
                                 └─ Version is ─┬─ version-number ─┬─┘
                                                ├─ HIGhest ────────┤
                                                └─ LOWest ─────────┘

─►──────────────────────────────────────────────────────────────────────────┬─►
  ─────────────────────────────────────────────────────────────────────────┬┘
  ─┬──────────────────────┬┬──────────────────────────────────────────────┬┘
   └ LANguage is language ┘└ PREpared by user-id ┬───────────────────────┬┘
                                                 └ PASsword is password ─┘

 ►─┬──────────────────────┬──┬──────────────────────────────────────┬─────────►◄
   └─ VERB ─┬─ DISplay ─┬─┘  └─ AS ─┬─ SYNtax ───┬──┬─────────────┬─┘
            ├─ PUNch ───┤           └─ COMments ─┘  └─ RECursive ─┘
            ├─ ADD ─────┤
            ├─ MODify ──┤
            ├─ REPlace ─┤
            └─ DELete ──┘

Parameters

ELement name is element-name

Identifies a new element to be established in the dictionary or an existing element to be modified, replaced, deleted, displayed, or punched. Element-name must be a 1- through 32-character alphanumeric value. (If you use element-name in a program, observe the maximum-character limit of the programming language.)

NEW NAMe is new-element-name

Specifies a new name for the requested element. If a version number is not specified, the version number defaults to the version associated with the element's original name. This clause changes only the name of the element occurrence; it does not alter or delete any relationships in which the element participates. Subsequent references to the requested element must specify the new name.

Note that if the element's primary synonym (the synonym that is identical to the primary name of the element) participates in a record, the element cannot be renamed.

NEW Version is

Specifies a new version number for the named element.

new-version-number/NEXt HIGHEST/NEXT LOWest

Specifies a version number for the named element. The element name and new version number must not duplicate that of an existing element name and version number.

VALue is ALL initial-value/condition-value

Associates (INCLUDE) or disassociates (EXCLUDE) a value, range of values, or a list of values assigned to a COBOL level-88 condition name. A list of values must be enclosed by parentheses, with values separated by a space or comma. Initial-value and condition-value can be 1- through 32-character numeric literals, quoted literals, or figurative constants.

Note: If the SET OPTIONS statement specifies DECIMAL-POINT ISCOMMA, the DDDL compiler interprets a period in numeric literal as an insertion character, and a comma as a decimal point.

THRu ALL condition-value

Specifies multiple values and ranges of values when the element is a COBOL level-88 condition name.

EXClude ALL VALUES

Removes all VALUE clauses from the element definition. The keyword VALUES cannot be abbreviated. Typically, the EXCLUDE ALL VALUES clause is used to remove the values associated with an element in preparation for adding subordinate elements.

RANge is start-value THRu end-value

Specifies a normal or expected value or range of values for the named element. Start-value and end-value must be 1- through 32-character numeric literals or figurative constants. Values that contain delimiters or embedded blanks must be enclosed in site-standard quotation marks. The user can enter each acceptable value in a separate RANGE clause or enter a range of values in one clause that includes the THRU option. For example:

range is 1 range is 3 range is 5

or

range is 1 thru 5

The RANGE clause is documentation except in the CA ADS Batch environment. CA ADS Batch uses RANGE clause values to validate input data fields (see CA ADS User Guide).

EXClude ALL RANGES

Removes all range clauses from the element occurrence.

PRImary

Specifies the default format of the named element. The PRIMARY/alternate-format-keyword clause is used in conjunction with the RECORD statement FORMAT clause to determine the format of an element within a record occurrence. For information about the FORMAT clause, see RECORD (REPORT/TRANSACTION), later in this chapter.

alternate-format-keyword

Specifies a keyword that corresponds to an alternate format established previously in the ALTERNATE PICTURE KEYWORD clause of the SET OPTIONS statement (see SET OPTIONS Statement). Up to four alternate formats can be defined for each element. The PRIMARY/alternate-format-keyword clause is used in conjunction with the RECORD statement FORMAT clause to determine the format of an element within a record occurrence. For information about the FORMAT clause, see RECORD (REPORT/TRANSACTION), later in this chapter.

PICture is

Identifies the named element as an elementary element and specifies its length and data type.

NULl

Removes the element's PICTURE, USAGE, SIGN, JUSTIFY, and BLANK WHEN ZERO clauses and all associated subordinate elements. NULl is the default.

Note: The maximum length of an element (including its usage) is 32,767 characters.

picture

In the case of a named element which has been previously defined as a group element, PICTURE IS picture removes any associated subordinate elements except COBOL level-88 condition names, and picture becomes the picture for the resulting elementary element.

Picture must be a 1- through 30-character value that describes alphanumeric, alphabetic, numeric, or numeric-edited data, as shown in the table under the bold heading Usage, after this parameter list.

USAge is

Specifies the physical storage characteristics of the named element.

DISplay

Identifies the usage as alphanumeric, zoned decimal, edited, or display floating point. DISPLAY is the default.

Note: For CA ADS users, additional information about defining display floating point numerics is available in the CA ADS Reference Guide.

usage

Identifies one of the following usages:

JUStify is

Defines COBOL justification specifications for the named element.

OFF

Specifies that a COBOL JUSTIFIED clause is not to be generated. OFF is the default.

ON

Specifies that a COBOL JUSTIFIED clause is to be generated.

BLAnk when ZERo is

Defines COBOL zero suppression requirements for the named element.

OFF

Specifies that a BLANK WHEN ZERO clause is not to be generated for COBOL. OFF is the default.

ON

Specifies that a BLANK WHEN ZERO clause is to be generated for COBOL.

SIGn is

Defines or deletes a sign specification for the named element.

NULl

Specifies that the sign and LEADING or TRAILING SEPARATE CHARACTER specification is removed from the named element.

LEAding/TRAiling

Specifies that a sign is associated with the named element. Further specifies that the sign appears in either the LEADING or the TRAILING position.

SEParate character

Reserves a separate character in the element definition for the sign designation.

SYNc

Specifies that the DDDL compiler must check the boundary alignment of COMP and COMP-4 record elements when the elements are included in a record. If a record element is not on a fullword or halfword boundary, the record is flagged in error.

NO SYNc

Specifies that the DDDL compiler will not check the boundary alignment of COMP and COMP-4 record elements when they are included in a record. NO SYNC is the default.

EXClude SUBordinate ELEments

Removes all subordinate elements, regardless of level number, from a group element. The PICTURE IS NULL specification (described above) ordinarily performs this function; however, if the subordinate elements are all level-88 condition names, the EXCLUDE SUBORDINATE ELEMENTS must be used. To replace existing subordinate elements with new subordinate elements, use the SUBORDINATE ELEMENTS clause (described below).

SUBordinate ELements are subordinate-element-name

Specifies that the named element is a group element and identifies one or more subordinate elements. Subordinate-element-name is the primary name of a subordinate element that exists in the dictionary. The SUBORDINATE ELEMENTS clause can be repeated to define a group structure of any size. Note that a list of subordinate-element names can be enclosed in parentheses to eliminate errors that can occur if an element name matches a DDDL keyword.

To define a filler as a subordinate element, specify an element name of 'FIL nnnn'; nnnn must be a 4-digit numeric value (leading zeros are required) and must be separated from the keyword FIL by one space. For example, to generate a filler described as FILLER PIC X(7), specify SUBORDINATE ELEMENT 'FIL 0007'. Note that filler fields need not exist in the dictionary in order to be included in group elements or records. An element can be named only once in a SUBORDINATE ELEMENTS clause; however, fillers can appear as often as required.

Each subordinate element can be qualified with either the OCCURS or R parameter.

OCCurs occurrence-count

Specifies that the subordinate element is a multiply-occurring element. Occurrence-count must be an integer in the range 1 through 32,767.

(R)

Redefines the previously named subordinate element. NOTE A redefined element cannot be defined with an OCCURS clause, however, it can be subordinate to an element defined with an OCCURS clause.

NOTE If a subordinate element must be defined with both an OCCURS and a REDEFINES clause, include the (R) option within the named element definition and the OCCURS option with the definition of the record in which the subordinate element participates.

ELement name SYNonym is element-synonym

Associates (INCLUDE) an alternative name with or disassociates it (EXCLUDE) from the element. Element-synonym must be a 1- through 32-character alphanumeric value.

All elements have at least one synonym, known as the primary synonym, with the same name and version as the element itself.

FOR GROup synonym group-element-name

Specifies that when the named element appears in a record as part of a group element whose name matches group-element-name, the specified element synonym is automatically used in the record. The following considerations apply:

WITh/ALSo WITh/WITHOut

Includes or excludes the specified options when the named element is displayed or punched. Detailed information for each DISPLAY/PUNCH option is under SET OPTIONS Syntax. The options that are listed below present special considerations for this entity type.

DETails

Includes the DESCRIPTION, VALUE, and RANGE specifications and PICTURE-related information for primary and alternative formats, including SUBORDINATE ELEMENTS specifications.

ELements

Includes all user-defined nests and subordinate elements.

MAPs

Includes the name of the map associated with the element occurrence or any of its synonyms.

PROgrams

Includes the name of the program and record associated with an element occurrence or any of its synonyms.

SYNonyms

Displays record synonyms associated with element synonyms.

Usage

Specifying a picture variable

Picture must be a 1- through 30-character value that describes the types of data shown in the following table.

Category

Character

Description

Alphanumeric data

X

Represents one alphanumeric character. If USAGE IS BIT, X represents one bit; the USAGE clause is described in the parameters list.

 

(n)

An integer in parentheses after an X

Represents n repetitions of the alphanumeric character; for example, X(4) is equivalent to XXXX.

Alphabetic data

A

Represents one alphabetic character (A-Z).

 

(n)

An integer in parentheses after an A

Represents n repetitions of the alphabetic character

Numeric data

9

Represents one numeric character.

 

(n)

An integer in parentheses after a 9

Represents n repetitions of the numeric character.

 

V

Represents an assumed decimal point. No more than one V can appear in an element picture. If the V is omitted and the P option (described below) is not used, the assumed decimal point is after the rightmost 9.

 

P

Represents an assumed zero. Any number of Ps can appear in the leftmost or the rightmost positions of an element picture. An assumed decimal point is automatically placed before the first P or after the last P. The character P does not occupy a storage position (for example, PP9999 has a data length of 4).

 

S

Identifies the number as positive or negative. When used, the S must be the first character in the element picture. When the S is omitted, values for the element description are assumed to be positive.

Numeric-edited data

(Includes the numeric data characters described above, along with the editing characters shown at the right)

 

Z

+

,

B

CR

-

0

DB

*

$

.

Represent edit symbols used in reporting data; quotation marks are not required. Refer to the appropriate programming language manual for the individual interpretations of these symbols.

If the SET OPTIONS statement specifies DECIMAL-POINT IS COMMA, a period (.) is interpreted as an insertion character and a comma (,) is interpreted as a decimal point.

If you specify REPLACE

If you specify REPLACE in the ELEMENT statement, the DDDL compiler initializes to defaults and/or excludes the following options:

The following relationships are not affected:

Examples

In the following example, the first three ADD statements define the elements DISCONTINUE-MONTH, DISCONTINUE-DAY, DISCONTINUE-YEAR, documenting the normal range of values for DISCONTINUE-MONTH as 01 through 12 and for DISCONTINUE-DAY as 01 through 31. The SET OPTIONS statement establishes a default PREPARED BY specification for the session. The fourth ADD statement establishes the group element DISCONTINUE-DATE and names its subordinate elements; the last ADD statement establishes an element called DISC-DATE-X.

add element discontinue-month
    prepared by dba password is 'ice 9'
    picture 99
    range is 01 thru 12.

set options for session
    prepared by dba password is 'ice 9'

add element discontinue-day
    picture 99
    range is 01 thru 31.

add element discontinue-year
    picture 99.

add element discontinue-date
    subordinate elements
         discontinue-month
         discontinue-day
         discontinue-year.

add element disc-date-x
    picture x(6).

In the following example, the first two ADD statements define the elements LOWER-LIMIT and QUANTITY-ON-HAND. The third statement adds the group element HISTORY and assigns four subordinate elements; (R) indicates that DISC-DATE-X (established in the previous example) redefines DISCONTINUE-DATE. DISCONTINUE-DATE is subordinate to HISTORY and is also a group element.

add element lower-limit
    prepared by dba password is 'ice 9'
    picture 999.

add element quantity-on-hand
    prepared by dba password is 'ice 9'
    picture 9(4).

add element history
    subordinate elements
         discontinue-date
         disc-date-x (r)
         lower-limit
         quantity-on-hand.

The following example illustrates usage of the PRIMARY/alternate-format clause to define alternate formats. SET OPTIONS establishes three alternate picture keywords; the definition of element GROSS-PAY includes three alternate formats. Element GROSS-PAY is associated with the WS-SALARY-HISTORY record; the FORMAT clause determines the format of the elements.

set options for dictionary
  first alternate picture keyword is edit-pic
  second alternate picture keyword is report-pic
  third alternate picture keyword is screen-pic.

add element name is gross-pay
   primary
       picture is s9(7)v99
       usage is comp-3
   edit-pic
       picture is x(9)
       usage is display
   report-pic
       picture is z,zzz,zzz.99
   screen-pic
       picture is 9(7)v99
       blank when zero is on.

add record name is ws-salary-history
   format is edit-pic.
   record element is gross-pay.
   .
   .
   .