2 Sort Statements and Functions
The first restriction is that only an integral number of logical records can be read or written. If a partial logical record is read, an error is issued and the record pointer is left at word one of the incompletely read record. If a partial logical record is written, the incompletely written record is not changed; instead, the record pointer at the beginning of that record and an error is issued. Strings cannot be read or written on workfiles. Arrays can be written or read by using the array notation (i.e. A(*), or via MAT PRINT # and MAT READ #.
Note that a pointer value is a value between 1 and the capacity of the set to which it pertains.
If a non-integral value is PRINTed on a workfile, it is rounded to an integer. If the rounded value is less than 1 or greater than the set capacity, an error occurs.
The record pointer for READ # and PRINT # can be positioned at any record from 1 through WFLEN + 1. Attempting to position past record number WFLEN + 1 results in an end-of-file error (which is trappable by ON END #). When printing to records greater than WFLEN, the value of WFLEN is adjusted appropriately. However, actually trying to read values in records beyond WFLEN causes end-of-file error.
PRINTing an END on a workfile resets WFLEN to a value corresponding to the record where END was printed -1. This effectively erases all information from the record where END was printed to the end of the workfile.