Master Files for DATACOM

In this section:

There are three types of Master File declarations.

Each declaration must begin on a separate line. A declaration consists of attribute-value pairs separated by commas. A declaration can span as many lines as necessary, as long as no single keyword-value pair spans two lines.

Do not use system or reserved words as names for files, segments, fields, or aliases. Specifying a reserved word generates syntax errors.

Top of page

File Attributes

Each Master File begins with a file declaration. The file declaration has two attributes, FILENAME and SUFFIX




Identifies the Master File. The file name can consist of a maximum of eight alphanumeric characters. The file name should start with a letter and be representative of the table or view contents.


Is the value for the Adapter for CA-DATACOM/DB.

Top of page

Segment Attributes

Each table described in a Master File requires a segment declaration. The segment declaration consists of at least two attributes, SEGNAME and SEGTYPE

SEGNAME=segname, SEGTYPE=type [,$]



Is the segment name that serves as a link to the actual DATACOM table name. It can consist of a maximum of 8 alphanumeric characters. It may be the same as the name chosen for FILENAME, the actual table name, or an arbitrary name.

The SEGNAME value in the Master File must be identical to the SEGNAME value specified in the Access File.


Indicates the type of segment sequencing:

SO indicates the segments are logically sequenced in low-to-high order.

U indicates a unique segment.

Top of page

Field Attributes


Each row in a table may consist of one or more columns. These columns are described in the Master File as fields with the following primary field attributes:


Identifies the name of a field.


Identifies the DATACOM 5-byte element short name to which the field belongs, along with a unique qualifier.


Identifies how to display a field on reports.


Identifies the datatype and length in bytes for a field.

You can get values for these attributes from the DATACOM DATA DICTIONARY Element Field Report.

The syntax for a field declaration is

FIELD[NAME]=fieldname, ALIAS=elementname.qualifier,
 [USAGE=]display_format, [ACTUAL=]storage_format ,$



Is the unqualified name of the field. You must describe the fields in the order in which they appear in the DATACOM element. You can find the DATACOM field names, their relative position within the element, and the DATACOM formats in the DATA DICTIONARY Element Field Report. This value must be unique within the Master File. The name can consist of a maximum of 66 alphanumeric characters. The name must begin with a letter. Special characters and embedded blanks are not recommended.

Note that some elements contain overlapping fields. You must define overlapping fields for those elements in which they appear, and assign a unique field name each time.

Note: You must describe all the columns of the DATACOM element in your Master File. However, if there is a column(s) you do not need, you can supply filler information as a placeholder.


Is the DATACOM 5-byte element short name, followed by a period, to which the field belongs. You can find the name in the DATACOM DATA DICTIONARY listing of Master Files.


Is the qualifier that is separated from the element name by a period. The qualifier is used to make the ALIAS unique and provide the field with an alternate identification. The total length of the ALIAS, including the element name and qualifier, cannot exceed 12 characters.


Is the display format. The value must include the field type and length and may contain edit options.

The data type of the display format must be identical to that of the ACTUAL format. For example, a field with an alphanumeric USAGE data type must have an alphanumeric ACTUAL data type.

Fields or columns with decimal or floating point data types must be described with the correct scale (s) and precision (p). Scale is the number of positions to the right of the decimal point. Precision is the total length of the field.

For the server, the total display length of the field or column includes the decimal point and negative sign. In SQL, the total length of the field or column excludes the decimal point and negative sign.

For example, a column defined as DECIMAL(5,2) would have a USAGE attribute of P7.2 to allow for the decimal point and a possible negative sign.

For related information, see USAGE Conversion Formats From DATACOM.


Is the storage format of the DATACOM data type and length, in bytes, for the field. You can find this under LNGTH in the field report.

Reference: USAGE Conversion Formats From DATACOM

The following table provides information about conversion formats for DATACOM data types.




USAGE Length

C (Character)


A (Alphanumeric)


N (Numeric; Zoned decimal)


P (Packed decimal)

n +1 (if decimal)
   +1 (if sign space)

D (Packed Decimal)


P (Packed decimal)

(2*n)-1 (+ 1 if decimal)
       +1 (if sign space)

B (Binary)


I (Integer)



I (Integer)




Is the DATACOM length (LNGTH) of the fields.