FDCLEAR

Specifies that the record buffer for a file should be cleared after every write operation.

Syntax:

>>-.---.-.-------FDCLEAR--"integer"--.-----><
   +-/-+ +.----.-FDCLEAR-------------+
          +-NO-+

Parameters:

integer
Must be one of:
1
Specifies that the record buffer for a file should be cleared after every write operation. The buffer is cleared to the value specified by the DEFAULTBYTE directive.
2
As for 1, except that the record buffer is also cleared after the initial OPEN statement.
3
As for 1, except that the record areas of print files are not cleared. (This is best emulation of mainframe behavior.)

Properties:

Default: NOFDCLEAR
Phase: Syntax check
$SET: Any

Comments:

The FDCLEAR directive is effective while the SELECT clauses are being processed. Use $SET statements before and after each SELECT clause to apply this feature to selected files. Alternatively, use it once before processing any SELECT statements to apply it to all files in a program.

The FDCLEAR directive is ignored for files subject to a SAME RECORD AREA clause in the I-O-Control paragraph.

Specifying FDCLEAR with no parameter has the same effect as specifying FDCLEAR "1".

Example:

In the following code, FDCLEAR is applied only to file-2:

 file-control.
     select file-1 ...
$set fdclear
     select file-2 ...
$set nofdclear
     select file-3 ...