Previous Page | Next Page

Functions for NLS

KPROPCASE Function



Converts Chinese, Japanese, Korean, Taiwanese (CJKT) characters.
Category: DBCS
Restriction: I18N Level 2

Syntax
Arguments
Details
Example

Syntax

str=KPROPCASE(<instr>, (<options>))


Arguments

str

data string that has been converted and is in the current SAS session encoding.

instr

input data string.

options

converts Japanese, Chinese, Korean, and Taiwanese characters based on specified options.

HALF-KATAKANA, FULL-KATAKANA

This option converts half-width Katakana to full-width Katakana and is used only with Japanese encoding.

Restriction: This option cannot be used at the same time with the full-Katakana, half-Katakana option.
FULL-KATAKANA, HALF-KATAKANA

This option converts full-width Katakana to half-width Katakana and is used only with Japanese encoding.

Restriction: This option cannot be used at the same time with the half-Katakana, full-Katakana option.
KATAKANA, ROMAJI

This option converts the Katakana character string to a Romaji character string and is used only with Japanese encoding.

Restriction: This option cannot be used at the same time with the Romaji, Katakana option.
ROMAJI, KATAKANA

This option converts the Romaji character string to a Katakana character string and is used only with Japanese encoding.

Restriction: This option cannot be used at the same time with the Katakana, Romaji option.
FULL-ALPHABET, HALF-ALPHABET

This option converts the Full-Alphabet characters to Half-Alphabet characters and is used only with Japanese, Chinese, Korean, and Taiwanese encoding.

Restriction: This option cannot be used at the same time with the Half-Alphabet, Full-Alphabet option.
HALF-ALPHABET, FULL-ALPHABET

This option converts the Half-Alphabet characters to Full-Alphabet characters and is used only with Japanese, Chinese, Korean, and Taiwanese encoding.

Restriction: This option cannot be used at the same time with the Full-Alphabet, Half-Alphabet option.
LOWERCASE, UPPERCASE

This option converts lowercase alphabet characters to uppercase alphabet characters.

Restriction: This option cannot be used at the same time with the Uppercase, Lowercase option.
UPPERCASE, LOWERCASE

This option converts uppercase alphabet characters to lowercase alphabet characters.

Restriction: This option cannot be used at the same time with the Lowercase, Uppercase option.
PROPER

This option specifies the following default options based on the encoding:

Japanese encoding:

  • Half-Katakana,Full-Katakana

  • Full-alphabet, Half-alphabet

  • Lowercase, Uppercase

Korean encoding:

  • Full-alphabet, Half-alphabet

Chinese encoding:

  • Full-alphabet, Half-alphabet

Taiwanese encoding:

  • Full-alphabet, Half-alphabet


Details

This function converts the input string based on the specified options and default options. The KPROPCASE function supports the Chinese, Japanese, Korean, Taiwanese (CJKT) environment.


Example

The following example demonstrates the functionality of the KPROPCASE function:

length fullkana halfkana upper lower fullalpha $ 200;
length str1 str2 str3 str4 str5 str7 str8 $ 30 str6 $44;

lower = 'do-naxtutsu';  /* Doughnuts in Japanese Roman word. */
upper = 'DO-NAXTUTSU';  /* Doughnuts in Japanese Roman word. */
fullkana = unicode('\u30C9\u30FC\u30CA\u30C3\u30C4');
halfkana = unicode('\uFF84\uFF9E\uFF70\uFF85\uFF6F\uFF82');
fullalpha = unicode('\uFF24\uFF2F\uFF0D\uFF2E\uFF21\uFF38\uFF34\uFF35\uFF34\uFF33\uFF35');

str1 = kpropcase(fullkana, 'full-katakana,half-katakana');
if (halfkana EQ trim(str1)) then
  put str1= $hex14.;
str2 = kpropcase(halfkana, 'half-katakana, full-katakana');
if (fullkana EQ trim(str2)) then
  put str2= $hex22.;

str3 = kpropcase(fullkana, 'katakana,romaji');
if (trim(str3) EQ upper) then
  put str3=  ;

str4 = kpropcase(upper, 'romaji,katakana');
if (trim(str4) EQ fullkana) then
  put str4= $hex22.;

str5 = kpropcase(fullalpha, 'full-alphabet, half-alphabet');
if (trim(upper) EQ str5) then
  put str5=;

str6 = kpropcase(upper, 'half-alphabet, full-alphabet');
if (trim(str6) EQ fullalpha) then
  put str6= $hex46.;

str7 = kpropcase(lower, 'lowercase, uppercase');
if (trim(str7) EQ upper) then
  put str7=;

str8 = kpropcase(upper, 'uppercase, lowercase');
if (trim(str8) EQ lower) then
 put str8=;

RESULTS:
str1=C4DEB0C5AFC220
str2=8368815B83698362836320
str3=DO-NAXTUTSU
str4=8368815B83698362836320
str5=DO-NAXTUTSU
str6=8263826E817C826D826082778273827482738272827420
str7=DO-NAXTUTSU
str8=do-naxtutsu

Previous Page | Next Page | Top of Page