CCSID (Coded Character Set Identifier) Keyword in DDS

Use this file-, record-, or field-level keyword to specify that a G-type field supports UCS-2 level 1 data instead of DBCS-graphical data.

The format of the keyword is:

CCSID(UCS2-CCSID | *REFC [alternate-field-length])

The USC-2-CCSID parameter is required. The UCS-2-CCSID parameter is used to specify a CCSID using the UCS-2 Level 1 encoding scheme for this field. The UCS-2-CCSID parameter is a number up to 5 digits long.

A special value of *REFC can be specified instead of a UCS-2-CCSID value. It is only valid on reference fields and the referenced field must be coded with a CCSID keyword specifing a UCS-2-CCSID value. Normally, the display file CCSID keyword would override any CCSID keyword attributes taken from the referenced field. If *REFC is specified, the UCS-2-CCSID value is taken from the referenced field.

On an output operation, if the CCSID keyword is specified, the corresponding field data in the output buffer will be converted from the UCS-2 Level 1 CCSID specified on this keyword to the CCSID of the device. On an input operation, the data is converted from the CCSID of the device to the UCS-2-CCSID specified on this keyword.

Like the current DBCS-graphic support, each UCS-2 character is 2-bytes long. The length of data displayed on the device after a conversion from a UCS-2-Level 1 CCSID to the device CCSID is dependent upon what CCSID the device is capable of. Therefore, it is important to provide an alternate field length using the alternate-display-parameter. This allows you to bypass the default field length to either avoid truncation of field data or to increase the display space on the screen by decreasing the field length.

The alternate-field-length parameter is optional and is only valid when the CCSID keyword is specified at the field level. This value will be used to control the actual field length instead of the field length specified on the field. The field length on the field will still be used to define the fields buffer length. The value entered for the alternate-field-length represents the number UCS-2 characters that would be displayed on the screen. When the CCSID keyword is at the file- or record level, or at the field level without the displayed field length parameter, the field length on the screen is 2 times the number of UCS-2 characters specified for the field length.

For example, a display file contains the following line:

FLD1         10G  B  2  2 CCSID(X Y)

If the CCSID keyword is specified at both the field-level and the record- or file-level, the field-level keyword takes precedence. If the CCSID keyword is specified at the file- or record-level and no G-type fields exist then a compile error is signalled.

On output, field data that is longer than the specified field length is truncated. On input, if too many characters were entered into the UCS-2 field, then the field is reverse imaged and an error appears on the error line stating too many characters were entered. You need to press reset and correct the field. The maximum number of characters to enter is conveyed in the error message.

The CCSID keyword can be specified with all of the following field level keywords:

ALIAS
AUTO(RA)
BLANKS
CHANGE
COLOR
DFT
DLTCHK
DSPRL
DUP
CHECK(FE)
CHGINPDFT
DFTVAL
DSPATR(BL)
DSPATR(CS)
DSPATR(HI)
DSPATR(MDT)
DSPATR(ND)
DSPATR(PC)
DSPATR(PR)
DSPATR(RI)
DSPATR(UL)
ENTFLDATR
ERRMSG
ERRMSGID
FLDCSRPRG
INDTXT
OVRATR
OVRDTA
PUTRETAIN
REFFLD
SFLCSRPRG
TEXT

Option indicators are not valid for this keyword.

DDS Coded Character Set Identifier (CCSID) Keyword--Example

Figure 467 shows how to specify the CCSID keyword.

Figure 467. Specifying the CCSID Keyword

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A                                      CCSID(13488)
00010A          R RECORD1
00020A            FIELD1        30G
00030A            FIELD2        10G         CCSID(61952 6)
00010A          R RECORD2                   CCSID(61952)
00020A            FIELD3        20G
     A

FIELD1 is assigned a CCSID value of 13488. FIELD2 is assigned a CCSID value of 61952 and has a display length of 6 UCS-2 characters long (12 SBCS characters). FIELD3 is assigned a CCSID value of 61952.