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

x
File Attributes

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

FILE[NAME]=filename, SUFFIX=DATACOM [,$]

where:

filename

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.

DATACOM

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


Top of page

x
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 [,$]

where:

segname

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.

type

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

x
Field Attributes

Reference:

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:

FIELDNAME

Identifies the name of a field.

ALIAS

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

USAGE

Identifies how to display a field on reports.

ACTUAL

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 ,$

where:

fieldname

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.

elementname

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.

qualifier

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.

display_format

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.

storage_format

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.



x
Reference: USAGE Conversion Formats From DATACOM

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

DATACOM Type

DATACOM Length

USAGE Type

USAGE Length

C (Character)

n

A (Alphanumeric)

n

N (Numeric; Zoned decimal)

 

P (Packed decimal)

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

D (Packed Decimal)

n

P (Packed decimal)

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

B (Binary)

2

I (Integer)

4

4

I (Integer)

10

where:

n

Is the DATACOM length (LNGTH) of the fields.


iWay Software