Format specifications
The following table shows where and how each of Business Rules! format specifications may be used. The first column identifies the format specification.
The second column labeled "Description" gives a very brief description of the format specification's purpose. The columns labeled "S", "N" and "I" indicate whether the specification is a string, numeric or internal format spec.
The next two columns show what happens when the format specification is used with internal or external files, either for input (with the READ/REREAD statements) or for output (with the WRITE/REWRITE statements).
The column labeled "PRINT (Output)"Print shows what happens when the format specification is used with display files.
The last two columns show what happens when the format specification is used with full screen processing, either for input (with the INPUT FIELDS statement) or for output (with the PRINT FIELDS statement). Note that the information marked for INPUT FIELDS applies to RINPUT FIELDS when RINPUT FIELDS is used for input. Likewise, the information marked for PRINT FIELDS applies to RINPUT FIELDS when RINPUT FIELDS is used for output.
If there is an X in any of the last five columns, the format specification operates according to its intended purpose when it is used as indicated. If there is an error code number in the column, the format specification cannot be used with this type of file (the specified error will occur if usage is attempted). In some cases, the phrase "treats as " appears in the column; this means that the specification is accepted when used as indicated, but treated as if it were a different format specification.
See Also
- File I/O (for more information about individual format specifications.)
- Error 1006
- Error 0816
- Error 0862
See the format specifications below for more details on each.
See also Format specifications for a chart comparing their uses.
Format specifications tell Business Rules the form that a particular data field will be in. A format specification is required whenever data is input into or output from a program. It is also required with the full screen processing statements. Format specs are not required in the following situations: with unformatted internal files, with all display files, and when unformatted PRINT statements are used.
Not all format specifications are alike in their uses. Some can be used with internal and external files, but not with display files. Some can be used only with full screen formatting. And some format specifications behave differently depending on whether they are used for input or output.
Common SQL Fields and BR Equivilants
SQL Field | BR Equivilant | Example |
---|---|---|
COUNTER | N | N 6 |
INTEGER | N | N 6 |
LONG INTEGER | N | N 12 |
SINGLE | S | S |
DOUBLE | D | D |
BINGINT | N/A | N 10 |
SMALLINT | BH | BH 2 |
FLOAT | L | N 6 |
DECIMAL | N or PD | N 12.2 or PD 6.2 |
DATETIME | N/A | Typically Stored as separate fields |
DATE | C or D | C 8 or D |
CHAR | C | C 30 |