A HEC-DSS squeeze rebuilds a DSS file. The rebuild will remove any unused (dead) space created from renaming or deleting records, optimize internal address tables (generally making record access faster) and attempt to repair any broken links or file errors. It is akin to defragmenting a hard drive. However, this operation takes time and requires exclusive access to the file, so it is recommended to perform only when warranted, usually when about 10% dead space is shown. For active DSS files, this would typically be less than once a month, or not at all. Once a file has been squeezed, deleted records cannot be recovered.
Because of space recycling in DSS version 7, the need to squeeze a file is less than in version 6. You can call the HecDSSUtilities function "squeezeNeeded()" to return a recommendation if a file should be squeezed or not. Or, you can the squeeze with the argument "true" to squeeze only if recommended. However, a DSS file should function correctly, regardless if it should be squeezed or not, just not as efficiently. Because of this, squeezes are typically done by the user from HEC-DSSVue, not from a regular program.
A squeeze must have complete exclusive access to the file, as it does OS file renaming and similar. You must also have rename and delete privilidges for a squeeze. As such, a squeeze operation should be in a main thread where it can be guaranteed that no other access to the file will be attempted during the squeeze process. The file should be closed before the squeeze and all other threads that could access it, held until it is finished.
HecDSSSUtilities:

public boolean squeezeNeeded();
public int squeeze ();
public int squeeze (boolean ifNeeded);
JAVA