Contains flag indicating whether end-of-file has been reached.
Following each sequential file
READ, Caché sets the $ZEOF special variable to indicate whether or not the end of the file has been reached. This special variable is provided for compatibility with MSM routines that use $ZC device status checking.
$ZEOF to the file status of the last device used. For example, if you read from a sequential file then write to the principal device, Caché resets $ZEOF from the sequential file end-of-file status to the principal device status. Therefore, you should check the $ZEOF value (and, if necessary, copy it to a variable) immediately after a sequential file READ.
$ZEOF to the following values:
1 End-of-file reached
0 Not at end-of-file
To use this feature, you must disable the <ENDOFFILE> error for sequential files.
To disable this system-wide, either set the SetZEOF property of the
Config.Miscellaneousclass, or go to the Management Portaland select System Administration, Configuration, Additional Settings, Compatibility([Home] > [Configuration] > [Compatibility Settings]). View and edit the current setting of SetZEOF. This option controls the behavior when Caché encounters an unexpected end-of-file when reading a sequential file. When set to true, Caché sets the $ZEOFspecial variable to indicate that you have reached the end of the file. When set to false, Caché issues an <ENDOFFILE> error. The default is false.
When the end of a file is reached, rather than issuing an <ENDOFFILE> error, the
READ will return a null string, set $ZB=null and set $ZEOF=1.
You cannot modify this special variable using the
SET command. Attempting to do so results in a <SYNTAX> error.