Previous Topic: Add Elements or Keys to the DataviewNext Topic: Catalog a DATABASE Structure


Define FIELD Occurrences to a TABLE

You can add, modify, and delete FIELD occurrences in a TABLE substructure by using one of the following procedures:

To add, modify, and delete FIELD occurrences (columns are defined as FIELD occurrences in CA Datacom Datadictionary) in a table that is accessible by SQL, the field must meet the conditions noted in this section.

When you select the DEFINE option on the TABLE Structure Functions Panel, you receive the following prompter panel:

=> => => 1-DDOL000196A - CMPP - PLEASE COMPLETE REQUIRED INFORMATION FOR COMMAND ------------------------------------------------------------------------------- DATACOM/DB Structure Maintenance TXCF DEFINE TABLE ________________________________ DEF TBL (name) with PASSWORD using OVERRIDE PSWD (pswd) OVRD (ovrd) PF1=HELP PF2=END PF3=CLARIFY PF4=PROCESS PF5=MENU PF6=STATUS PF7=SCB PF8=SCF PF9=APPLY PF10=PATH PF11=NEXT PF12=INPUT

The following list describes each field, the valid entries and the default (if one exists). Fields that require an entry are highlighted on your terminal. Fields which are not highlighted indicate that an entry is optional.

(name)

(Required) Specify the occurrence name for the TABLE substructure.

Valid Entries:

1 to 32 characters

Default Value:

(No default)

(pswd)

Only required if this occurrence has protection against unauthorized maintenance with a password assignment. Supply the password for this occurrence.

Valid Entries:

1- to 4-character password

Default Value:

(No default)

(ovrd)

Only required if this occurrence is restricted from unauthorized maintenance or retrieval with a lock level assignment. Supply the override code.

Valid Entries:

1- to 4-character override code

Default Value:

(No default)

When you press Enter, the FILE Maintenance Panel appears. If the TABLE has existing FIELD occurrences, the panel displays the FIELD occurrences in the order that they were defined. You can add, move, and delete FIELD occurrences and change attribute-values of the occurrences, with the exception of the Field-name and DB Element-name attribute-values. For more information and the commands you can use on this panel, see Line Commands.

Significant Changes

If you make a significant change to a field through CA Datacom Datadictionary or an SQL ALTER statement, CA Datacom Datadictionary indicates this by changing the SIGNIFICANT-CHG attribute-value to Y. Performing a CATALOG function on the structure alters the date/time stamp on all dataviews using any element containing this field. This indicates to the CA Ideal user that the dataview must be recataloged before using.

If your modifications to the FIELD occurrences changes the length of the table or reduces the length of the keys and elements, CA Datacom Datadictionary automatically calculates the changes for you. If you add a new FIELD occurrence between the first and last FIELD occurrences of an element or if the FIELD occurrence is inserted as part of a compound field used in a key definition, CA Datacom Datadictionary automatically calculates these changes. Otherwise, you must modify the ELEMENT and KEY definitions.

If the FIELD occurrence you add is accessed by CA Ideal programs or included in copybooks generated by CA Datacom Datadictionary as other than filler, modify the ELEMENT occurrence to include the new FIELD occurrence or occurrences. For more information, see Add ELEMENT Substructures.

Field Maintenance Panel

If FIELD occurrences have not been defined to the TABLE substructure, CA Datacom Datadictionary presents a FILE Maintenance Panel similar to the following:

=> => => 1-DDOL000407I - 03IP - TABLE HAS NO RELATED FIELDS ------------------------------------------------------------------------------- DDOL: ANCHORED OCCURRENCE FOR TABLE FIELD MAINTENANCE TYPE OCCURRENCE STA VER TBL ACCTS T 001 ---------------------------------------------------------------------------T03U Level Field-Name DB Element-Name Preci Type Len Repeat Just Rdf Null Fill (Num:Sign Type Dec) ====== == ======== ================== T O P ======= ===== ==================== 000001 1 ________________________________ _____ _____ _ _____ _____ _ _ _ _ _ _ ___ ====== == ======== =============== B O T T O M ==== ===== ==================== PF1=HELP PF2=END PF3=CLARIFY PF4=PROCESS PF5=MENU PF6=STATUS PF7=SCB PF8=SCF PF9=APPLY PF10=PATH PF11=NEXT PF12=INPUT

When the display is longer than the screen, you can use the scroll commands or PF keys to move backward and forward through the display.

First Line of Attributes

The following attributes are on the first line of attributes for each FIELD occurrence:

Level

(Required) Specify the level of the FIELD occurrence. CA Datacom Datadictionary uses your entry to assign the CLASS attribute-value of the field.

For more information about entering values in this field, see the CLASS attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Note: SQL statements can access simple fields only. A simple field is any field that is not the parent of a subordinate level of fields, a value field, an index field, or a filler field. For more information, see Define FIELD Occurrences to a TABLE.

Valid Entries:

1 Simple field or Compound field
2—99 Occurrence level within a compound field
V Value field
I Index field

Default Value:

(No default)

Field-Name

(Required) Specify the CA Datacom Datadictionary name of the FIELD occurrence.

Valid Entries:

1- to 32-character occurrence name

Default Value:

(No default)

DB Element-Name

(Optional) Specify a name to create an element which contains only this field. You can use this attribute only when you initially define the FIELD occurrences to a table.

For more information, see the DATACOM-NAME attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

5-character DATACOM name for ELEMENT

Default Value:

(No default)

Second Line of Attributes

The following attributes are on the second line of attributes for each FIELD occurrence:

Preci

(Required) Specify the maximum number of displayable digits allowed for data stored in fields whose TYPE is D (decimal), G (graphic), N (numeric), V (varchar), or W (vargraphic).

For more information, see the PRECISION attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

5 characters

Default Value:

D = 2x LENGTH minus 1
G = LENGTH
N = LENGTH
V = LENGTH minus 2
W = (LENGTH minus 2) divided by 2

Type

(Optional) The TYPE attribute-type specifies the type of data stored in the FIELD occurrence. There are special considerations for attributes if you are using SQL.

For more information, see the TYPE attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

CA Datacom/DB supports the following data types.

Valid Entries:

B, C, D, E, G, H, K, L, N, S, T, V, Y, Z, 2, 4, or 8

Default Value:

C

Len

(Optional) Specify the physical length of the field in bytes. To account for the 2-byte length prefix on variable columns, for VARCHAR (TYPE=V) and VARGRAPHIC (TYPE=W) two (2) is added to the value specified for the physical length. For more information, see the LENGTH attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

Maximum: 32720 bytes for all fields in the TABLE

Default Value:

1

Repeat

(Optional) Specify if this is a repeating field.

During SQL processing, repeating fields are handled as one large character field. For more information, see the REPEAT attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

Number of repetitions

Default Value:

1

Just

(Optional) This attribute-value specifies if the data is stored left (L) or right (R) justified. If you are defining the TABLE substructure for SQL processing, always use the default value.

For more information, see the JUSTIFICATION attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

L, R

Default Value:

L (left) for Types C, G, H, K, T, V, Y, and Z

R (right) for Types B, D, E, L, N, S, 2, 4, and 8

Rdf

(Optional) Specify if this field redefines another field.

Redefines cannot be accessed with SQL processing. For more information, see the REDEFINES attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

N, P, or S

Default Value:

N

Null

(Optional) Enter Y if a 1-byte null indicator is to precede this field. Enter Y for nullable fields (SQL default) and N for NOT NULL fields.

For more information, see the NULL-INDICATOR attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

N or Y

Default Value:

N

Fill

(Optional) Specify if the field is a filler field. If you enter Y (yes), CA Datacom Datadictionary assigns F as the attribute-value of the CLASS attribute-type. If the FIELD occurrence is not a filler, leave this attribute blank.

Valid Entries:

Y

Default Value:

blank

The three attributes following NUM: within the parentheses are for numeric fields (types B, D, E, L, N, S, 2, 4, or 8). Leave these attributes blank if the field type is not numeric.

Sign

(Optional) Specify if the field contains signed numeric data (Y) or unsigned data (N). For more information, see the SIGN attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

Y or N

Default Value:

Y

Type

(Optional) If the field is signed numeric, specify the signing convention for the field. For more information, see the TYPE-NUMERIC attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

C Conventional
P Conventional always positive
U Unconventional
Q Unconventional, always positive

Default Value:

C

Dec

(Optional) Specify the number of decimal positions for a numeric field with an implied decimal point. For more information, see the DECIMALS attribute-type for FIELD occurrences in the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

Number of decimal positions

Default Value:

0

Press PF9 (APPLY) after completing your entries. If there are no errors, CA Datacom Datadictionary displays the Field Summary Display Panel with the message confirming successful field maintenance. The Field Summary Display Panel lists the FIELD occurrences, the attribute-values you specified and the attribute-values you allowed to default.

Note: The FIELD occurrence numeric attribute-values (SIGN, TYPE-NUMERIC, and DECIMALS) for the binary types (B, 2, 4, and 8) and the packed decimal type (D) are displayed on the panel only when the DECIMALS attribute has a value other than zero.

If an entry for a field is incorrect, you receive an error code in the column to the left of Level on the FILE Maintenance Panel after you press PF9 (APPLY). For more information, see the section on field maintenance error codes in the CA Datacom/DB Message Reference Guide.

Update Additional FIELD Occurrence Attribute-Values

You can update or reset additional attributes for a FIELD occurrence that are not displayed on the FILE Maintenance Panel or the Field Summary Display Panel. To access the Field Attribute Update Panel, type the margin command ATT (for UPDATE ATTRIBUTE) in the line number for each FIELD you are updating.

When you press PF4 (PROCESS), CA Datacom Datadictionary presents the first FIELD occurrence from the online work queue on an Attribute Update Panel for FIELD occurrences. For more information and a list of attributes, see the section on FIELD attribute-types in the CA Datacom Datadictionary Attribute Reference Guide.

After completing entries on the Attribute Update Panel, press PF9 (APPLY). If there are no errors, CA Datacom Datadictionary displays the Attribute Display Panel with the message SUCCESSFUL ATTRIBUTE UPDATE.