Master Files for Model 204

In this section:

How to:

A Model 204 file consists of records and fields. It can represent one file or a collection of files called a group. If records have identical sets of fields, the unit of records is called a logical record type. A logical record type is described as a single segment in the Master File.

A Master File consists of file, segment, and field declarations. Rules for declarations are:

The following sections summarize the syntax for each type of declaration and then present detailed explanations for each attribute.


Top of page

x
Syntax: How to Declare File Attributes

Each Master File begins with a file declaration that names the file and describes the type of data source, a Model 204 file or group in this case. The file declaration has two attributes, FILENAME and SUFFIX

FILE[NAME]=name, SUFFIX=M204IN [,$]

where:

name

Is a 1- to 8-character name that identifies the Master File. The name must comply with server file naming conventions.

M204IN

Is the SUFFIX value that specifies the Adapter for Model 204.


Top of page

x
Syntax: How to Declare Segment Attributes

Each logical record type described in a Master File requires a segment declaration that consists of at least two attributes, SEGNAME and SEGTYPE

SEGNAME={name|DUMMY}, SEGTYPE={S0|U} [, PARENT=parent] ,$

where:

name

Is a 1- to 8-character name that identifies the segment. The value DUMMY creates a virtual segment used for joining unrelated segments.

S0

Indicates to the adapter that the Model 204 DBMS handles the storage order of the data. S0 is the default setting.

parent

For multi-segment structures (Embedded Joins) only, is the SEGNAME value for the parent record type. This attribute is required in segment declarations that describe dependent segments.


Top of page

x
SEGNAME

The SEGNAME (or SEGMENT) attribute identifies each Model 204 logical record type. The SEGNAME value can be a maximum of 8 alphanumeric characters. It may be the name of the record type or an arbitrary name and must be unique within a Master File.

The SEGNAME value from the Master File is also specified in the Access File where the segment declaration identifies the name of the Model 204 file. In this manner, the SEGNAME value serves as a link to the actual Model 204 file name.


Top of page

x
SEGTYPE

In a single segment Master File, the SEGTYPE value is S0. The Model 204 DBMS handles the storage order of the data.

In a multi-segment Master File, SEGTYPE values for dependent segment declarations can be S0 or U (for unique).

If the SEGTYPE attribute is omitted from any segment record in the Master File, its value defaults to S0.


Top of page

x
PARENT

How to:

The PARENT attribute is required in dependent segment declarations. Its value is the SEGNAME value of the dependent record type's parent (the logical record type to which it will be related at run time).



x
Syntax: How to Declare Field Attributes

Each record in a logical record type consists of one or more fields. These Model 204 fields are described in the Master File with the primary attributes FIELDNAME, ALIAS, USAGE, and ACTUAL. You are only required to describe Model 204 fields you use in reports, and you can specify them in any order within each segment

FIELD[NAME]=field, [ALIAS=] [m204field], [USAGE=]display, [ACTUAL=]An ,$

where:

field

Is a 1- to 66-character field name. In requests, the field name can be qualified with the Master File and/or segment name. Although the qualifiers and qualification characters do not appear in the Master File, they count toward the 66 character maximum.

m204field

Is the Model 204 field name, which can be up to 66 characters (or, optionally left blank if the field name exceeds 66 characters and is described in the Access File).

display

Is the server display format for the field.

An

Is the server definition of the Model 204 field format and length (n).

You can omit the ALIAS, USAGE, and ACTUAL keywords from the field declaration if the values are specified in the standard order (FIELD, ALIAS, USAGE, ACTUAL). For example, the following declarations are equivalent:

FIELD = YEAR, ALIAS=YEAR, USAGE=A2, ACTUAL=A2,$
FIELD = YEAR, YEAR, A2, A2,$

Top of page

x
FIELDNAME

Field names must be unique within the Master File and may consist of up to 66 alphanumeric characters. Model 204 field names are acceptable values if they meet the following naming conventions:

Since the field name appears as the default column title for reports, select a name that is representative of the data. You can specify field names, aliases, or a unique truncation of either in requests.

Duplicate field names (the same field names and aliases) within a segment are not permitted. Requests can qualify duplicate field names from different segments with the name of the Master File and/or segment.

Note: Field names specified in OCCURS segments may not be qualified.


Top of page

x
ALIAS

The ALIAS value for each field must be the full Model 204 field name; the adapter uses it to generate HLI calls. The ALIAS name must be unique within the segment. If the name is longer than the 66 character maximum, leave the ALIAS attribute blank in the Master File and specify the alias in the Access File instead. The ALIAS name must comply with the field naming conventions listed previously. If the Model 204 field name contains an embedded blank, enclose the name in single quotation marks.

Aliases may be duplicated within the Master File if they are defined for different Model 204 logical record types. However, the corresponding field names must be unique. For example, the ALIAS values for two Model 204 record type fields may be RECTYPE, but the field names must be unique.

Note: Do not use RECTYPE as a field name.


Top of page

x
USAGE

The USAGE attribute indicates the display format of the field. An acceptable value must include the field type and length and may contain edit options. The server uses the USAGE format for data display on reports. All standard server USAGE formats (A, D, F, I, P) are available.


Top of page

x
ACTUAL

How to:

The ACTUAL attribute indicates the server representation of Model 204 field formats as returned by the Model 204 DBMS in the data buffer. Specify an alphanumeric format (A) with a length (n) equal to the maximum length for the Model 204 field. If the ACTUAL length is less than the maximum length for the Model 204 field, field values will be truncated.

Note: Since Model 204 file descriptions do not define field lengths, ask your Model 204 database administrator or consult other sources, such as data dictionaries, for field information.



x
Syntax: How to Declare OCCURS Attributes

Describe each multiply occurring field that exists in a Model 204 record as an OCCURS segment. The segment declaration for an OCCURS segment consists of the SEGNAME, PARENT, and OCCURS attributes. It contains one field declaration to represent the multiply occurring field, and, optionally, a field declaration for an internal counter, the ORDER field. Each OCCURS segment is described as a dependent segment. Its parent segment describes all non-repeating fields from the logical record type. You do not have to describe an OCCURS segment if you do not plan to use the multiply occurring field in report requests

SEGNAME=segname, PARENT=parentname, OCCURS=VARIABLE,$

where:

segname

Is the 1- to 8-character name of the OCCURS segment.

parentname

Is the SEGNAME value of the parent segment that contains the non-repeating fields from the logical record type.

VARIABLE

Indicates that the number of occurrences varies.

Note:



x
Syntax: How to Track a Sequence Within Multiply Occurring Fields

The ORDER field is an optional counter that you can define to identify the sequence number of each multiply occurring field when the order of data is significant. You can use its value in subsequent report requests. The ORDER field does not represent an existing Model 204 field; it is used only for internal processing. The ORDER field must be the last field described in the OCCURS segment

FIELD=name, ALIAS=ORDER, USAGE=In, ACTUAL=I4,$

where:

name

Is any meaningful name.

ALIAS

Must be ORDER.

USAGE

Is an integer (In) format.

ACTUAL

Must be I4.

The following annotated example illustrates an OCCURS segment in the VEHICLE Master File.

 
1. SEGNAME=VEHICLE,$
     FIELD=VVIN ,ALIAS=VIN  ,A10 ,A10 ,$
     FIELD=YEAR ,ALIAS=YEAR ,A2  ,A2  ,$
     FIELD=MAKE ,ALIAS=MAKE ,A16 ,A16 ,$ 
2. SEGNAME=XOTHDR, PARENT=VEHICLE, OCCURS=VARIABLE ,$ 
3.   FIELD=OTHER_DRIVERS, ALIAS='OTHER DRIVER' ,A6 ,A6 ,$ 
4.   FIELD=DRVCNT, ALIAS=ORDER ,I4 ,I4 ,$

Notice that:

  1. Is the segment declaration for the parent segment, VEHICLE.
  2. Is the OCCURS segment declaration.
  3. Is the field declaration for the multiply occurring field. Field qualifiers (Master File and segment names) are not permitted, but the TYPE attribute can define a suffix operator in the Access File.
  4. Is the field declaration for the ORDER field. As an internal counter field, it does not correspond to a Model 204 field.

WebFOCUS