Previous Topic: Add Areas to the DatabaseNext Topic: Add Elements or Keys to the Dataview


Create DATAVIEW Structures

Use the CREATE function to define a root occurrence for a structure. In the DBMAINT Mode, there are only two structures, DATABASE and DATAVIEW. The root of a DATAVIEW structure is a DATAVIEW occurrence. You use the ADD function to define the base occurrence of a substructure, such as an AREA occurrence for an AREA substructure.

How It Works

A dataview is comprised of elements or keys in the same table. You can use one or more elements or keys to define a dataview. When you define a dataview, list the elements in the order in which you want them to appear in a copybook.

Dataviews used by DL can be comprised of elements and keys. Define keys to the dataview if it is used for record-at-a-time processing. For more information about how DL uses dataviews, see the Online COBOL/DL User Guide and the COBOL/DL Language Reference.

Dataviews used by CA Ideal can be comprised of elements. You can include keys in the dataview definition, but CA Ideal ignores the keys when accessing data. CA Ideal searches for data according to the field specified in the "WHERE clause" of a program "FOR construct." Specify whether the CA Ideal dataview is used for updating functions and not only for read-only functions. If the CA Ideal program is to use the dataview for updating functions, specify the attribute-value for the update attribute as Y (yes).

You cannot include the same FIELD occurrence in more than one ELEMENT occurrence defined to a DATAVIEW occurrence.

You cannot use a CA Ideal/PDL reserved word as the name of a DATAVIEW occurrence. For more information, see the reserved word list in the CA Ideal Application Development Reference Guide.

You must catalog a dataview using the CA Ideal CATALOG command before CA Ideal can use the dataview. For more information about cataloging dataviews, see the CA Ideal Administrator Guide.

How to Use

You can define a DATAVIEW structure by using one of the following procedures:

When you select the CREATE function on the Structure Functions Menu Panel, you receive the following prompter panel:

=> => => 1-DDOL000196A - CMPP - PLEASE COMPLETE REQUIRED INFORMATION FOR COMMAND ------------------------------------------------------------------------------- DATACOM/DB Structure Maintenance TCCF CREATE DATAVIEW ________________________________ in STATUS ____ CRE DVW (name) STAT (status) with PASSWORD using LOCK 0 LIKE ________________________________ PSWD (pswd) LOC (lock) LIKE (name) ACCESSING ELEMENTS ACC (type) 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.

DATAVIEW (name)

(Required) Specify the name for the DATAVIEW occurrence.

Note: CA Ideal does not allow DATAVIEW occurrence names up to 32 characters. See the person responsible for administering CA Ideal on your system for the maximum for your version of CA Ideal.

Valid Entries:

1- to 32-character name

Default Value:

(No default)

(status)

(Required) Specify the status for the new occurrence. The status must match the status of the ELEMENT or KEY occurrences which are related to the dataview. For example, if you are creating a DATAVIEW occurrence which is related to an existing ELEMENT occurrence in T003 status, specify T003 status for the DATAVIEW occurrence.

Valid Entries:

T001—T999

Default Value:

(No default)

(pswd)

(Optional) Specify a password to protect this occurrence from unauthorized updates. For more information about protecting definitions, see the CA Datacom Datadictionary User Guide.

Valid Entries:

1 to 4 alphanumeric characters

Default Value:

(No default)

(lock)

(Optional) Specify a lock level to restrict access to this occurrence. For more information about protecting definitions, see the CA Datacom Datadictionary User Guide.

Valid Entries:

0, 1, or 2

Default Value:

0

LIKE (name)

(Optional) Specify the name of an existing DATAVIEW occurrence in the same status to use as the model for the occurrence you are creating.

Note: Any aliases or descriptors assigned to the existing occurrence are not duplicated for the new occurrence. Define these separately.

Valid Entries:

1- to 32-character occurrence name

Default Value:

(No default)

(type)

(Optional) Specify the entity from which the dataview obtains information. The panel displays the default attribute-value, ELEMENTS. If you are relating keys to the dataview, use the ERASE key to clear this field and type in KEYS.

Valid Entries:

ELEMENTS

KEYS

Default Value:

ELEMENTS

When you press Enter, CA Datacom Datadictionary displays the DATAVIEW definition panel. If you specified keys instead of elements for the dataview, the screen divider title displays "KEYS accessed by the DATAVIEW."

=> => => ------------------------------------------------------------------------------- DATACOM/DB STRUCTURE MAINTENANCE CREATE TUVU ............................ DATAVIEW ATTRIBUTES .............................. Name: ACCTS-DVW Status/Version: T001 Table : ______________________________ Update: _ .................. ELEMENTS accessed by the DATAVIEW .......................... Name ====== ============ T O P ============= 000001 ________________________________ ====== ========= 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

The following list describes each attribute, the valid entries, and the default (if one exists). Attributes that require an entry are highlighted on your terminal. Attributes which are not highlighted indicate that an entry is optional. If you do not assign a value to these attributes, they default to the value assigned in CA Datacom Datadictionary.

Table:

(Required) Specify the occurrence name of the TABLE substructure containing the ELEMENT or KEY occurrences to be related to the DATAVIEW.

Valid Entries:

Occurrence name of an existing TABLE substructure

Default Value:

(No default)

Update:

(Optional) Specify Y (yes) to allow a CA Ideal program to use this DATAVIEW for updating functions. To only allow read-only functions, you can allow this attribute to default to N.

For more information about the UPDATE-INTENT attribute-type, see the CA Datacom Datadictionary Attribute Reference Guide.

Valid Entries:

N or Y

Default Value:

N

Name

(Required) If you are relating ELEMENT occurrences to the dataview, fill in the ELEMENT occurrence names. A FIELD occurrence cannot be contained in more than one element related to the same dataview. If you are relating KEY occurrences to the dataview, fill in the KEY occurrence names.

Note: Entries on this panel must be maintained in the order in which you expect the data to return by CA Datacom/DB.

Valid Entries:

Existing ELEMENT or KEY occurrence name

Default Value:

(No default)