Defining ending record for a report (endrec)

endrec

Define ending record for a report


SYNTAX

endrec key = expr_list

Define the last record to be read from the driving file. The statement may be placed at any point before or during the report. If an end key is set during the report, and the driving file has already passed that key, no more records are processed and the report ends.

expr_list

The key by which the ending record is to be read, consisting of one or more key values, each of which may be a field, expression or quoted string:

key = expression [, expression]…

The data in the first expression listed is assigned to the first key field of the record, the data in the second to the second key field and so on. Standard rules of assignment are used. If the number of expressions listed is fewer than the number of file key fields, the extra keys are set blank. If the number of expressions listed is greater than the number of file key fields, the extra expressions are discarded.

See The key = clause. If there is no record in the driving file which is an exact match for the key fields provided, the report ends after processing the record with the next lower key.


EXAMPLE

!init {
     read Control key = tmp.UserCode
     startrec key = ct_sdate
     endrec key = ct_edate
}

RELATED TOPICS

Reports

!drive

startrec