Version 4.2.6 for Mainframes (Update)
 —  Operations  —

Double-Byte Character Sets

This document is only relevant for Asian countries which use double-byte character sets. It describes all features implemented in Natural to support DBCS terminals and printers and covers the following topics:


Natural Profile Parameter SOSI

In alphanumeric fields with SBCS and DBCS characters mixed, the DBCS character strings are separated from the SBCS strings by shift codes called SO (shift-out) and SI (shift-in). The Natural profile parameter SOSI is used to pass the values of the shift-in and shift-out codes used in the current environment to Natural.

It is strongly recommended to use the IBM characters X'0E' and X'0F' internally. With this technique, all applications and data can be handled in a compatible manner, which means that a network supporting different mainframe types can still use the same Natural applications and process the same data.

For detailed information on this parameter, see SOSI.

Top of page

Output Format Specification

The Natural session parameter PM=D is used to define DBCS-only fields. A DBCS-only field must contain only valid DBCS characters; shift-out/shift-in characters (SO/SI) are not allowed within such a field. To display a field with the session parameter PM=D specified, the screen attribute X'43F8' is added for IBM terminals; for Fujitsu terminals, the field content is enclosed in the required shift-out/shift-in characters (SO/SI).

Top of page

Parameter Definitions for DBCS Support

The following parameters must be specified in the setup for Natural for the support of double-byte character sets:

Parameter Explanation
TS=ON If Latin lower-case characters are not available, this parameter translates all Natural system output using the translation table defined by the macro NTTABL in the NATCONFG module.
SOSI=(0E,0E,0F,0F,1) Defines the DBCS shift-out and shift-in values for IBM hardware.
SOSI=(28,28,29,29,0) Defines the DBCS shift-out and shift-in values for Fujitsu hardware.
LC=ON Does not translate all input data to uppercase, which again would destroy possible DBCS input data.

In addition to TS=ON, further parameters to provide for translation of messages into upper case are provided by several Natural components. For detailed information, see Other Parameters to Provide Upper Case Translation in the TS profile parameter documentation.

Top of page

Editor Profile Options

If you want to enter DBCS or half-width Katakana characters in one of the Natural editors, the following editor general default options should be set in the editor profile to avoid that character constants or field names containing DBCS or half-width Katakana characters are unintentionally converted to upper case:

Option Value Explanation
Editing in Lower Case Y Lower-case characters in the source code are not automatically converted to upper case. This option is required if you are using DBCS or half-width Katakana characters.
Dynamic Conversion of Lower Case N Any source code remains as you enter it. This option is required if you are using half-width Katakana characters.

For detailed information on the editor general default options, see General Defaults. For detailed information on the editor profile, see Editor Profile in the Editors documentation. To avoid the need to change these options for every user, you can modify the default profile for your installation by means of the user exit routine USR0070P, which also supports DBCS; see USR0070P - User Exit for Editor Profiles in the section Configuring Natural.

Top of page

Input Data Check

If the session parameter PM=D is set for a field, it is verified that the input data

Because the detection of non-DBCS characters requires ICU, this check will not be performed if ICU is not available (that is, if the profile parameter CFICU=OFF has been set).

Top of page

Output Data Adjustment

If a window is to be displayed for user interaction, the window might overlay DBCS characters that are already displayed, or the window might itself contain DBCS characters which are truncated because of the window size. An overlay may also occur if the NO ERASE option is used with an INPUT statement. In order to prevent screen corruption in case of such an overlay, the following actions are performed to adjust the output data, if necessary:

Top of page

Natural Stack Data

To avoid unintentional interpretation of DBCS characters as delimiter or control characters, the FORMATTED option of the STACK statement should be used if the data to be placed on the Natural stack contains DBCS characters.

See the Statements documentation for further information on the STACK statement.

See the Programming Guide for further information on the Natural Stack.

Top of page

Application Programming Interfaces for DBCS Handling

The following user application programming interfaces (API) are available to support DBCS handling:

These APIs are contained as subprograms in the Natural library SYSEXT. Detailed information on how to use an API is included in the corresponding text member (USRxxxxT). See also SYSEXT Utility - Natural Application Programming Interfaces in the Utilities documentation.

USR4211N - Get DBCS Characters

The application programming interface USR4211N can be used to obtain information on the availability of DBCS support and the defined SOSI characters.

USR4213N - String Handling for DBCS Support

The application programming interface USR4213N can be used to perform the following functions:

The last two functions can be used to either produce native DBCS strings or generate mixed-mode data out of native DBCS strings.

Top of page