/div>
<div class="line">CLOSE FH</div>
</div><!-- fragment --><p><b>Error handling around a write</b> </p><div class="fragment"><div class="line">ON ERROR PROCfile_err</div>
<div class="line">FH = OPENOUT(&quot;out.txt&quot;)</div>
<div class="line">WRITE FH, &quot;line&quot;</div>
<div class="line">CLOSE FH</div>
<div class="line">END</div>
<div class="line"> </div>
<div class="line">DEF PROCfile_err</div>
<div class="line">    PRINT &quot;Write failed: &quot;; ERR$</div>
<div class="line">ENDPROC</div>
</