FORMAT Syntax

You can use generated formats or user-written formats. Literals for defining these formats are in the section that follows.

Generated FORMAT

To declare a generated format, use the following syntax:

[type] FORMAT formatname
formatoption1
.
.
.
formatoptionn

—or—

COBOL FORMAT formatname USING FILTER filtername
formatoption1
.
.
.
formatoptionn

User-written FORMAT

To declare a user-written format, use the following syntax:

INTERNAL FORMAT formatname IN "patchfiletitle"

—or—

EXTERNAL FORMAT formatname IN "librarytitle"

 

Where

Is

type

Optional. type represents DISPLAY, BINARY, RAW, VARYING, EXTERNAL, INTERNAL, or COBOL as explained in “Type” in the following table. If you enter a type, do not include the brackets.

formatname

Required. formatname is the name of the format you will enter in DATABridge accessory parameter files when you want to use this particular format.

The name must start with a letter followed by letters, numbers, or underscores. The only limit on the length of the format name is the length of a record in the parameter file, which for SEQDATA files is 72 characters.

formatoption

Optional. formatoption is any of several methods of formatting the data. See Format Options.

USING FILTER filtername

Required for COBOL formats only. See COBOL FORMAT.

Literals for Defining Formats

The following table lists the literals used with formats that can be defined.

Type

Description

DISPLAY FORMAT formatname

DISPLAY indicates that the fields are formatted in readable format. All numbers, Booleans, etc., are converted to EBCDIC text. If you don't include a type, GenFormat uses DISPLAY as the default.

Valid format options: All (for example, POSITIVE, UNSIGNED, TEXT, etc.)

VARYING FORMAT formatname

While similar to DISPLAY, VARYING discards trailing spaces in alpha items and discards leading zeros in numeric items. NULL items are represented as empty strings. This format type is intended for writing comma-separated values to a stream file.

Valid format options: Same options as DISPLAY except NULL and OVERFLOW options are ignored.

BINARY FORMAT formatname

BINARY indicates the fields are bit images from the original record.

Valid format options: TRANSLATE for specifying a translation table for text items

RAW FORMAT formatname

RAW indicates the original record is output without editing or data item filtering.

Valid format options: None

COBOL FORMAT formatname USING FILTER filtername

COBOL indicates that GenFormat will generate a COBOL85 library program to handle record formatting.

Valid format options: All except for TRANSLATE, OVERFLOW, and DATANAME. For more information, see COBOL FORMAT.

INTERNAL FORMAT formatname IN "patchfiletitle"

INTERNAL indicates that the (user-written) formatting routine is included as a patch file when the Support Library is compiled.

Valid format options: None

EXTERNAL FORMAT formatname IN "librarytitle"

EXTERNAL indicates that the (user-written) formatting routine is an entry point in a library program.

Valid format options: None