BINARY directive

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 cannot be used in combination with the VAR_LENGTH directive.

The method of storing fields declared as binary is database-specific. For example, Oracle uses the data type raw for the field.




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.
         05  code-num            pic 9(5).
         05  code-suffix         pic x(3).
 move low-values to code-num.