Tuesday, June 23, 2009

Character String and Byte String Processing in Unicode Programs

In Unicode programs, character string and byte string processing are strictly separated. The operands of character string processing must be character-like data objects, and operands in byte string processing must be byte-like data objects. In non-Unicode programs, byte strings are normally handled in the same way as character strings.

Syntactic separation

Statements for character string and byte string processing

In the statements for character string and byte string processing, in Unicode programs, the distinction is made in the statements that are intended for both types of processing by the optional addition IN CHARACTER|BYTE MODE. In this case, IN CHARACTER MODE is the default.

Note

The addition IN CHARACTER|BYTE MODE is also used in the statements for determining length and offset:

  • DESCRIBE FIELD ... LENGTH
  • DESCRIBE DISTANCE

In this case, the specifications are obligatory

Relational operators for character strings and byte strings

There are relational operators for character strings and for byte strings. In Unicode programs, the latter can no longer be used for byte strings.

Functions for character strings and byte strings

The description functions are divided into description functions for character strings and description functions for byte strings. In particular, in Unicode programs, strlen can now only be used for character-like arguments, while xstrlen is available for byte-like arguments.

No comments:

Blog Archive