RECSOUT


1 RECSOUT(ddname)

Returns the count of records so far written to the specified output data set.

The argument you can specify is:
ddname
Specifies that the count of records so far written to the data set identified by the specified ddname be returned.

The count of records written to an output data set is incremented each time a WRITE function is issued against the specified data set. In the case of the primary output data set, the count is also incremented each time a record is written to the data set by the FM/Db2 function. Unless a record is discarded using the RETURN DROP (or STOP IMMEDIATE) instruction, each record selected for processing is written to the primary output data set.

Example 1

If more than one hundred records have been written to the EXT100 file, stop FM/Db2 processing.
rc = WRITE(EXT100)
if RECSOUT(EXT100) > 100 then exit "STOP"

Related tasks