Caché ObjectScript Reference
[Home] [Back] [Next]
InterSystems: The power behind what matters   

Contains end-of-stream status when reading a compressed stream.
$ZEOS contains a boolean value that indicates whether the end of an incoming (compressed) stream has been received and processed. If $ZEOS=1, an end-of-stream for a compressed data stream has been received. The $ZEOS value is only meaningful when stream compression/decompression is active (/GZIP=1). You activate stream compression/decompression by issuing the /GZIP command keyword from an OPEN or USE command.
You must check the $ZEOS value before disabling stream compression/decompression by changing the setting to /GZIP=0. If you issue a USE command with /GZIP=0 before the end of a compressed incoming stream has been processed, the USE generates a <TRANSLATE> error. If the end of the compressed incoming stream has not been reached ($ZEOS=0) you must issue block READ commands until $ZEOS=1.
This special variable cannot be modified using the SET command. Attempting to do so results in a <SYNTAX> error.
The following example begins with /GZIP=1 (compression enabled). It performs a loop which tests for $ZEOS=1, and issues READ commands until $ZEOS=1. It then can set /GZIP=0 (compression disabled):
  OPEN dev:/GZIP=1
  READ block#length
       READ x:10 }
  USE dev:/GZIP=0
See Also

Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA