_ddfld.utl Utility - FIELD Interface Module

Syntax

call "_ddfld.utl",old_data$,action{,new_data$,options,
idx_seg_array$[ALL]}

Description

The _ddfld.utl utility is the interface module for fields defined in the data dictionary. With this program, users can:

  • Retrieve parameters for a given field.

  • Add a new field to the data dictionary, or modify an existing field.

  • Remove a field from the data dictionary.

  • Copy data dictionary information from one field to another.

  • Parameter

    Description

    old_data$

    This can be passed to _ddfld.utl as a complete record. It is returned as a dimensioned string of complete_field$, filled in with the requested data. For more information, see Data Dictionary Record Templates.

    action

    Action, as follows:

     

    0 Query.

     

    1 Add/Modify.

     

    2 Remove.

     

    3 Copy.

     

    4 Export from data dictionary - Creates a string template based on existing data dictionary information.

     

    5 Import to data dictionary - Create data dictionary information based on a string template.

    new_data$

    If ACTION=3 (copy), this DIMensioned string contains the name of the FIELD record being copied TO.

    options$

    Options, as follows:

     

    "s" Silent.

     

    "m" During field delete, do not remove FIELD and FLDRUL information.

     

    "i" During template query or load, do not add index information.

     

    "E" During template query, do not include field attributes.

     

    "l" During template query, do not include field attributes or type information.

     

    "f" Reserved for TAOS.

    idx_seg_array$$[all]

    Reserved for TAOS.

     

Examples

ACTION=0

The following queries information about the CUST_NUM field:

DIM FIELD1$:STBL("#FIELDCOMP")
FIELD1.FILE_ID$="CUSTOMER"
FIELD1.FIELD_ID$="CUST_NUM"
CALL BBEXT$+"_ddfld.utl",FIELD1$,0

ACTION=0

The following silently queries information about the CUST_NUM field:

DIM FIELD1$:STBL("#FIELDCOMP")
FIELD1.FILE_ID$="CUSTOMER"
FIELD1.FIELD_ID$="CUST_NUM"
CALL BBEXT$+"_ddfld.utl",FIELD1$,0,$$,"s"

ACTION=1

The following changes the field description in the CUST_NUM field:

DIM FIELD1$:STBL("#FIELDCOMP")
FIELD1.FILE_ID$="CUSTOMER"
FIELD1.FIELD_ID$="CUST_NUM"
CALL BBEXT$+"_ddfld.utl",FIELD1$,0
LET FIELD1.DESCR$="Customer number (key)."
CALL BBEXT$+"_ddfld.utl",FIELD1$,1

ACTION=2

The following removes the CUST_NUM field from the data dictionary:

DIM FIELD1$:STBL("#FIELDCOMP")
FIELD1.FILE_ID$="CUSTOMER"
FIELD1.FIELD_ID$="CUST_NUM"
CALL BBEXT$+"_ddfld.utl",FIELD1$,2

ACTION=3

The following copies CUST_NUM field information to EMP_NUM:

DIM FIELD1$:STBL("#FIELDCOMP")
FIELD1.FILE_ID$="CUSTOMER"
FIELD1.FIELD_ID$="CUST_NUM"
DIM FIELD2$:STBL("#FIELDCOMP")
FIELD2.FILE_ID$="PAYROLL"
FIELD2.FIELD_ID$="EMP_NUM"
CALL BBEXT$+"_ddfld.utl",FIELD1$,3,FIELD2$

ACTION=4

The following exports a record layout from the data dictionary by creating a string template based on information defined in the data dictionary:

CALL BBEXT$+"_ddfld.utl","ITEM",4,TEMPLATE$

ACTION=5

The following imports a record layout into the data dictionary by updating a record layout from a string template:

TEMPLATE$="item_num:n(4),descrip:c(12),cost:n(12),
supplier:c(20)"
CALL BBEXT$+"_ddfld.utl","ITEM",5,TEMPLATE$

One application-specific extension to the template string is recognized. The extension may include as many other field attributes as will fit in the field definition (up to 255 bytes). Or, the format order_date:i(4):type=idate will define this field based on the selected TYPDEF reference.

See Also

Alphabetical EUS Utilities

Functional Listing of EUS Utilities

FIELD Data Dictionary File

FILE Data Dictionary File

Demonstration Database describes the CUSTOMER alias used in the examples.