Processing data in an international environment
COBOL for Linux® supports Unicode UTF-16 as national character data at run time. UTF-16 is a fixed-width Unicode encoding that provides a consistent and efficient way to encode plain text. Using UTF-16, you can develop software that will work with various national languages.
About this task
Use these COBOL facilities to code and compile programs that process national data and culturally sensitive collation orders for such data:
- Data types and literals:
- Character data types, defined with the
USAGE NATIONAL
clause and aPICTURE
clause that defines data of category national, national-edited, or numeric-edited - Numeric data types, defined with the
USAGE NATIONAL
clause and aPICTURE
clause that defines a numeric data item (a national decimal item) or an external floating-point data item (a national floating-point item) - National literals, specified with literal prefix
N
orNX
- Figurative constant
ALL
national-literal - Figurative constants
QUOTE
,SPACE
,HIGH-VALUE
,LOW-VALUE
, orZERO
, which have national character (UTF-16) values when used in national-character contexts
- Character data types, defined with the
- The COBOL statements shown in the related reference below about COBOL statements and national data
- Intrinsic functions:
NATIONAL-OF
to convert an alphanumeric or double-byte character set (DBCS) character string toUSAGE NATIONAL
(UTF-16)DISPLAY-OF
to convert a national character string toUSAGE DISPLAY
in a selected code page (EBCDIC, ASCII, EUC, or UTF-8)- The other intrinsic functions shown in the related reference below about intrinsic functions and national data
- The
GROUP-USAGE NATIONAL
clause to define groups that contain onlyUSAGE NATIONAL
data items and that behave like elementary category national items in most operations - Compiler options:
NSYMBOL
to control whether national or DBCS processing is used for theN
symbol in literals andPICTURE
clausesNCOLLSEQ
to specify the collating sequence for comparison of national operands
You can also take advantage of implicit conversions of alphanumeric or DBCS data items to national representation. The compiler performs such conversions (in most cases) when you move these items to national data items, or compare these items with national data items.
Related tasks
Using national data (Unicode) in COBOL
Converting to or from national (Unicode) representation
Processing UTF-8 data using UTF-16 (national) data types
Processing Chinese GB 18030 data
Comparing national (UTF-16) data
Coding for use of DBCS support
Setting the locale
Using national data (Unicode) in COBOL
Converting to or from national (Unicode) representation
Processing UTF-8 data using UTF-16 (national) data types
Processing Chinese GB 18030 data
Comparing national (UTF-16) data
Coding for use of DBCS support
Setting the locale
Related references
COBOL statements and national data
Intrinsic functions and national data
NCOLLSEQ
NSYMBOL
Classes and categories of data (COBOL for Linux on x86 Language Reference)
Data categories and PICTURE rules
(COBOL for Linux on x86 Language Reference)
MOVE statement (COBOL for Linux on x86 Language Reference)
General relation conditions (COBOL for Linux on x86 Language Reference)
COBOL statements and national data
Intrinsic functions and national data
NCOLLSEQ
NSYMBOL
Classes and categories of data (COBOL for Linux on x86 Language Reference)
Data categories and PICTURE rules
(COBOL for Linux on x86 Language Reference)
MOVE statement (COBOL for Linux on x86 Language Reference)
General relation conditions (COBOL for Linux on x86 Language Reference)