Report Definition Language syntax and usage

The following conventions are used to document the syntax of the Report Definition Language statements:

Here’s an example:

1. Report Definition Language syntax

General usage rules

QUESTION CITY TYPE ALPHANUMERIC SIZE 30 
PROMPT "City:" DEFAULT "*" INFO 
LINE "Enter name of city."

“Press ‘Enter’ to continue”

Recommended statement order

To ensure that your Report Definition Language statements are loaded properly, we recommend you define them in the following order. The statements you’d use are in parentheses.

1. Define the report name and all files. (REPORT, FILE)
2. Define all temporary fields in the order in which you want them evaluated. (CALCULATION, ENVIRONMENT, QUESTION, SUBTOTAL, TEMPTEXT)
3. Define all selections and sorts. (SELECT, SORT)
4. Define each line in the order you want it to appear in the report, along with all of its fields and text. (FIELD, LINE, TEXT)
5. Define any miscellaneous report options. (MISCELLANEOUS)

Field_spec definition

A number of the RDL statements require a field_spec, which is a specification for a field in a report. A field specification may optionally contain subscript or range information.

field [FID fid]
field[[subs_value[,subs_value ...]]] [FID fid]
field[(offset:length)] [FID fid]

field

A unique field name. If field alone does not identify a unique field, file.field or file.structure.field must be specified. Field can be a maximum of 30 characters and cannot contain spaces.

FID fid

(optional) The owner file ID. Specify this keyword if a file and structure combination has been selected more than once.

subs_value

(optional) Either a numeric literal or a nonranged, nonsubscripted field name to be used as a subscript value for an arrayed field. (Notice that if one or more subs_value arguments are present, they must be enclosed in square brackets. The arguments must be separated by a comma and can contain no embedded spaces.)

Because an arrayed field can have up to four dimensions, the field can have up to four subscript values.

offset

(optional) Either a numeric literal or a nonranged, nonsubscripted field name to be used as the base one offset position to range “from.”

length

(optional) Either a numeric literal or a nonranged, nonsubscripted field name to use as the “length” of the range.

ARCUST
ARRATE[3]
ARCUST(1:15)
ARTRANS.ARTRANS.ARCUST FID 1

Condition_spec definition

Conditional_spec is a specification for a condition or set of conditions in a report. It is used after the IF or the SELECT keyword.

field_spec  compare  value  [TRUEIFBLANK][connect  field_spec  compare  value  [TRUEIFBLANK]]  [...]

field_spec

A specification for a field. (See Field_spec definition above.)

compare

The operator used to compare field_spec with value. Valid values are:

EQ = Equal to

NE = Not equal to

LE = Less than or equal to

LT = Less than

GE = Greater than or equal to

GT = Greater than

value

Either a literal or another field specification. If value is a literal value, enclose it in quotation marks. (See the examples for CALCULATION and LINE.)

TRUEIFBLANK

(optional) Indicates that the conditional evaluates to TRUE if the field_spec operand is blank or zero.

connect

(optional) The connector used if you’re specifying two or more conditions. If you specify connect, you must also specify field_spec, compare, and value. Valid values are AND and OR.

Up to five conditions can be connected together for all conditional_specs, except those used in selections, which can have up to 25.

ARRATE[3] EQ "400"
TEMP.QDATE GE TRANS.START_DATE
    AND TEMP.QDATE LE TRANS.END_DATE
SALES.REP EQ TEMP.QREF TRUEIFBLANK