The BINARY directive is used to specify that the data in the field could be alphanumeric data of any classification. Absolutely any data is allowed.
The BINARY directive may not be used in combination with the VAR-LENGTH directive.
The method of storing fields declared as binary is database-specific. For example, with Informix databases, binary data is stored in char fields with an extra leading character. This character always contains a space. Oracle uses the data type raw for the field.
Syntax
$XFD BINARY
or
*(( XFD BINARY ))
Example
You might use this directive when you need to store a key that contains LOW-VALUES; COBOL allows a numeric field to contain LOW or HIGH values, but these are invalid for a numeric field in the RDBMS:
01 code-record.
03 code-key.
05 code-indic pic x.
*(( XFD BINARY ))
05 code-num pic 9(5).
05 code-suffix pic x(3).
.
.
.
move low-values to code-num.