Converting alphanumeric, DBCS, and integer to national (MOVE)

You can use a MOVE statement to implicitly convert data to national representation.

About this task

You can move the following kinds of data to category national or national-edited data items, and thus convert the data to national representation:

  • Alphabetic
  • Alphanumeric
  • Alphanumeric-edited
  • DBCS
  • Integer of USAGE DISPLAY
  • Numeric-edited of USAGE DISPLAY

You can likewise move the following kinds of data to numeric-edited data items that have USAGE NATIONAL:

  • Alphanumeric
  • Display floating-point (floating-point of USAGE DISPLAY)
  • Numeric-edited of USAGE DISPLAY
  • Integer of USAGE DISPLAY

For complete rules about moves to national data, see the related reference about the MOVE statement.

For example, the MOVE statement below moves the alphanumeric literal "AB" to the national data item UTF16-Data:


01  UTF16-Data  Pic N(2) Usage National.
    . . . 
    Move "AB" to UTF16-Data

After the MOVE statement above, UTF16-Data contains NX'41004200', the national representation of the alphanumeric characters 'AB'.

If padding is required in a receiving data item that has USAGE NATIONAL, the default UTF-16 space character (NX'2000') is used. If truncation is required, it occurs at the boundary of a national-character position.

Related references  
MOVE statement (COBOL for Linux on x86 Language Reference)