Previous Page Contents Page Next Page

4.2 Description File Format

The description file is made up of a number of field descriptors that describe the field name, data type, and field length of each field in the file.

The description file format is as follows:

PCFDF[comment]
PCFT file_type_indicator [comment]
PCFL field_name_1 data_type_1 length_1 [decimal_position_1][comment]
.
.
PCFL field_name_n data_type_n length_n [decimal_position_n][comment]
[* comment]

The following items apply to the whole file:

The following list describes the meaning and format of each entry in the description file:

PCFDF

Identifies the file as a description file. It must start in column one of the first line of the file.

PCFT

Identifies the record as containing a file type indicator. This is followed by the indicator which identifies the type of Solaris file in which the data is stored. It must start in column one, after the PCFDF record, and before any PCFL records and must only appear once. It can be one of the following:

1

Specifies ASCII text. The data in all field types is converted to character representations of the data in ASCII form (for instance a hexadecimal value is converted to 2 characters, each representing one half of the hex byte in ASCII).

2

Specifies ASCII data. Any EBCDIC-encoded fields are converted to ASCII. Numeric data is flipped as appropriate for the operating system, and stored as a double or long integer type depending on whether the field contains decimal places. All other data remains the same.

6

Specifies No-conversion file. The data is copied to and from the host byte by byte with no conversion taking place.

This entry can be followed by an optional comment. For example:

PCFT 1 ASCII TEXT FILE

PCFL

Identifies a definition for a field. There is one PCFL entry for each field in the Solaris file. The PCFL entries must be in the same order as the fields that they define in the data file. The maximum number of PCFL entries is 256, and each entry can have a maximum of 80 characters. Each entry contains the following:

  • The PCFL keyword, starts in column one, and is followed by a space.

  • The field name can be from 1 to 10 characters long and must match the name that exists in the data definitions. It is followed by a space.

  • The data type indicator represents the local data type of the data in the field (and must be valid for the file type specified in the PCFT entry). It is followed by a space.

  • The field length is number of bytes that the data in this field occupies in the local computer, which can be from 1 to 4 characters. The maximum lengths allowed for each data type are listed below:

  • If there is a decimal position associated with the data in the field, place a forward slash (/), followed by the number of decimal positions, after the length specification. Do not put any spaces between the length, slash, and decimal position specification.

    The number specified here refers to the number of positions from the right-hand byte of the resulting decimal number. You can only specify a decimal position for floating-point numbers when the data type is one of: Numeric, Binary, Packed, or Zoned.

    The number of decimal positions in a field is from 0 to 9, or the maximum number of decimal digits in the number (whichever is smallest). The transfer function may round the number in order to fit it into the field.

  • You can include a comment, which must be separated from the field length entry by a space.

The data type indicators can be one of the following:

1

Specifies Character, and is valid with the ASCII text and ASCII data file types. The maximum field length for this data type is 4096.

2

Specifies Numeric, and is valid with the ASCII text file type. The maximum field length for this data type is 33.

3

Specifies Hexadecimal, and is valid with the ASCII data and No-conversion file types. The maximum field length for this data type is 256.

4

Specifies Binary, and is valid with the ASCII data and No-conversion file type. The maximum field length for this data type is 4.

5

Specifies Zoned, and is valid with the ASCII data file type. The maximum field length for this data type is 31.

6

Specifies Packed, and is valid with the ASCII data file type. The maximum field length for this data type is 16.

10

Specifies EBCDIC, and is valid with the No-conversion file type. The maximum field length for this data type is 4096.

11

Specifies EBCDIC zoned, and is valid with the No-conversion file type. The maximum field length for this data type is 4096.

12

Specifies EBCDIC packed, and is valid with the No-conversion file type. The maximum field length for this data type is 4096.

13

Specifies DBCS OPEN, and is valid with the No-conversion file type. The maximum field length for this data type is 4096.

14

Specifies DBCS ONLY, and is valid with the No-conversion file type. The maximum field length for this data type is 4096.

15

Specifies DBCS EITHER, and is valid with the No-conversion file type. The maximum field length for this data type is 4096.

This entry can be followed by an optional comment. For example:

PCFL ITEMIZED 1 20 DESCRIPTION OF ITEM

Comment Entries

You can enter comment lines anywhere in the description file. Comment lines must:

  • Have an asterisk (*) as the first nonspace character in the line

  • Not exceed 80 characters in length

  • Not be the first record in the description file

For example:

* This is a comment line

4.2.1 Example Description File

The following is an example of a description file for an inventory file:

     PCFDF
     PCFT 1 ASCII TEXT FILE
     * ITEM INVENTORY FILE
     PCFL ITEMNO 2 8 ITEM NUMBER
     PCFL ITEMDESC 1 20 DESCRIPTION OF ITEM
     PCFL COLOR 1 8 COLOR
     PCFL WEIGHT 2 7/2 ITEM WEIGHT
     PCFL PRICE 2 7/2 PRICE PER ITEM
     PCFL INSTOCK 2 6 ITEMS IN STOCK

Previous Page Contents Page Top of Page Next page