UniData International - Rocket Documentation Library

Rocket UniData
UniData International
Version 7.3.7
July 2014
UDT-737-UDTI-1
Notices
Edition
Publication date: July 2014
Book number: UDT-737-UDTI-1
Product version: Rocket UniData 7.3.7
Copyright
© Rocket Software, Inc. or its affiliates 1985-2014. All Rights Reserved.
Trademarks
Rocket is a registered trademark of Rocket Software, Inc. For a list of Rocket registered trademarks
go to: www.rocketsoftware.com/about/legal. All other products or services mentioned in this
document may be covered by the trademarks, service marks, or product names of their
respective owners.
Examples
This information might contain examples of data and reports. The examples include the names of
individuals, companies, brands, and products. All of these names are fictitious and any similarity
to the names and addresses used by an actual business enterprise is entirely coincidental.
License agreement
This software and the associated documentation are proprietary and confidential to Rocket
Software, Inc. or its affiliates, are furnished under license, and may be used and copied only in
accordance with the terms of such license.
Note: This product may contain encryption technology. Many countries prohibit or restrict the
use, import, or export of encryption technologies, and current use, import, and export
regulations should be followed when exporting this product.
2
Corporate information
Rocket Software, Inc. develops enterprise infrastructure products in four key areas: storage,
networks, and compliance; database servers and tools; business information and analytics; and
application development, integration, and modernization.
Website: www.rocketsoftware.com
Rocket Global Headquarters
77 4th Avenue, Suite 100
Waltham, MA 02451-1468
USA
To contact Rocket Software by telephone for any reason, including obtaining pre-sales
information and technical support, use one of the following telephone numbers.
Country
United States
Australia
Belgium
Canada
China
France
Germany
Italy
Japan
Netherlands
New Zealand
South Africa
United Kingdom
Toll-free telephone number
1-855-577-4323
1-800-823-405
0800-266-65
1-855-577-4323
800-720-1170
0800-180-0882
08-05-08-05-62
800-878-295
0800-170-5464
0-800-022-2961
0800-003210
0-800-980-818
0800-520-0439
Contacting Technical Support
The Rocket Customer Portal is the primary method of obtaining support. If you have current
support and maintenance agreements with Rocket Software, you can access the Rocket Customer
Portal and report a problem, download an update, or find answers in the U2 Knowledgebase. To
log into the Rocket Customer Portal or to request a Rocket Customer Portal account, go to
www.rocketsoftware.com/support.
In addition to using the Rocket Customer Portal to obtain support, you can send email to
[email protected] or use one of the following telephone numbers.
Country
North America
United Kingdom/France
Europe/Africa
Australia
New Zealand
Toll-free telephone number
+1 800 729 3553
+44(0) 800 773 771 or +44(0) 20 8867 3691
+44 (0) 20 88673692
+1 800 707 703 or +61 (0) 29412 5450
+0800 505 515
3
Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta
Table of
Contents
Table of Contents
Chapter 1
Introduction to UniData International
What is Internationalization? . . . . .
What UniData International Provides . .
Language Groups . . . . . . . . .
Language Group ID . . . . . . .
UniBasic Programming . . . . . .
Date, Numeric, and Currency Formats.
Language Message Files . . . . . . .
Language Message Default Record . .
Customization . . . . . . . . .
General Rules . . . . . . . . . . .
Definitions, Acronyms, Abbreviations . .
Chapter 2
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1-3
1-4
1-5
1-6
1-7
1-7
1-9
1-9
1-10
1-11
1-12
. . . . .
. . . .
.
2-3
. .
. .
. .
.
.
.
3-3
3-5
3-11
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3-12
3-13
3-15
3-16
3-18
. . . .
. . . .
. . . .
.
.
.
4-3
4-6
4-7
Customizing UniData International
Editing the DEFAULTS Record . . . . . . . . . . .
Adding a Language to a Language Group . . . . . . .
Starting UniData SQL in a Local Language . . . . . . .
UDT.OPTIONS 53
U_PMOD_THROWAWAY . . . . . . . . . . .
Using Menus to Translate VOC Keywords . . . . . . .
Sorting Order . . . . . . . . . . . . . . . . .
Adding a Record to the COLLATIONS File . . . . .
Pointing to a New Record in the Language Message File
Chapter 4
.
.
.
.
.
.
.
.
.
.
.
Language Configuration
Starting UniData in a Language Group .
Chapter 3
.
.
.
.
.
.
.
.
.
.
.
Commands Reference
DATE.FORMAT .
LIST.LANGGRP .
SET.LANG . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . . .
. . . . .
. . . . .
C:\Users\awaite\Documents\U2Doc\UniData\7.3\Source\UDTI\UDTITOC.fm (bookTOC.template)
June 20, 2014 2:00 pm
SET.MONEY . . . . . .
SET.DEC . . . . . . . .
SET.THOUS . . . . . .
UPDATE.LANG.DEFAULTS .
convmark . . . . . . .
Chapter 5
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4-9
4-12
4-14
4-16
4-19
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5-3
5-4
5-5
5-6
5-7
5-15
5-15
5-17
5-18
5-19
5-20
5-21
5-22
5-23
5-24
Multibyte Language Reference
Limitations and Exclusions . . . . .
Storing Characters . . . . . . . .
Displaying Characters . . . . . . .
Multibyte Configuration File . . . . .
Adding a Multibyte Language to UniData
UniBasic Multibyte Support . . . . .
Modified Functions and Commands
Singlebyte Functions . . . . . .
Multibyte Functions . . . . . .
BYTELEN . . . . . . . . . . .
CHARLEN . . . . . . . . . . .
DISPLAYWIDTH . . . . . . . . .
ISMB . . . . . . . . . . . . .
LEN . . . . . . . . . . . . .
MBLEN . . . . . . . . . . . .
Appendix A
.
.
.
.
.
UniData and UNIX Locale
Table of Contents 5
Chapter
Chapter 1: Introduction to
UniData International
What is Internationalization? . . . . .
What UniData International Provides . .
Language Groups . . . . . . . . .
Language Group ID . . . . . . .
UniBasic Programming . . . . .
Date, Numeric, and Currency Formats
Language Message Files. . . . . . .
Language Message Default Record .
Customization. . . . . . . . .
General Rules . . . . . . . . . .
Definitions, Acronyms, Abbreviations . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1-3
1-4
1-5
1-6
1-7
1-7
1-9
1-9
1-10
1-11
1-12
This manual describes what Rocket UniData provides for internationalization and localization. Applications developed in this environment enable
the end user to input and display information in the local language. Information in this manual is provided in English because the system or database
administrator who is configuring and using UniData must do so in English.
Use this manual in conjunction with Using UniData and the UniData
Commands Reference.
This manual is organized in the following way:

Chapter 1, Introduction to UniData International — introduces you
to the concepts of internationalization, including localization,
language group, and locale, and includes a list of other terms used
throughout this manual.

Chapter 2, “Chapte 2: Language Configuration” — explains how to
use the language configuration script to run UniData in your
language.

Chapter 3, “Chapter 3: Customizing UniData International” —
describes the utilities and commands available to customize UniData
for your environment.

Chapter 4, “Chapter 4: Commands Reference” — explains ECL
commands relevant to UniData International.

Chapter 5, “Chapter 5: Multibyte Language Reference” — describes
tools designed for languages using multibyte character sets.
1-2
What is Internationalization?
The demand for new computer technology worldwide is increasing, and in
order to be accessible to a wider audience of users, software developers have
found a need to adapt products to different languages. UniData has
answered this need by broadening our database product to handle a variety
of languages and regional conventions.
A vital part of internationalization is localization, the process of providing
language-specific and region-specific information. This means that a French
user is able to input and display data in French and receive error messages in
French. Internationalization may also customize the UniData display of time,
date, and monetary signs.
1-3 UniData International
What UniData International Provides
UniData International enables you to start UniData in your local language
after you install UniData. When you start UniData in your language, it
provides the following:

Language groups — allows for storage of characters that can be
translated to the appropriate language by the terminal emulator
client.

Localized language message files — stores messages that can be
translated to the appropriate language by the user’s terminal
emulator client.

Time, date, numbers, and monetary sign — UniData automatically
honors default conventions for date, numbers, and currency.

Customization — allows you to customize defaults and to translate
keywords and commands.
UniData relies on the host operating system to provide National Language
Support (NLS). However, if ported to an operating system that does not
support internationalization, UniData is still able to perform limited
internationalization functions such as allowing the user to customize
regional information in the MSG.DEFAULTS file and to localize UniData
messages.
Note: To take full advantage of UniData International, the underlying operating
system must conform to the Portable Operating System Interface (POSIX)
specification in terms of LOCALE support. See Appendix A, “UniData and UNIX
Locale,” and your host documentation for further information.
1-4
Language Groups
Language groups are UniData’s way of separating languages into divisions.
UniData reserves the use of certain delimiters as record marks. French and
Japanese are part of UniData Language Group 2, although the languages are
very different. This is because UniData is able to use the same delimiters for
both languages.
The UniData delimiters are described in the following table.
@variables
Group 1
ASCII
Value
Group 2
ASCII
Value
Meaning
0
0
0
0
Escape sequence mark.
Print @
N/A
192
130
Device control function for
UniBasic output.
(white space)
N/A
129
129
Mark reserved for the
NULL value. For more
information on NULL
value, see Using UniData.
Remove 1
N/A
249
153
Used by UniBasic
REMOVE statements.
Remove 2
N/A
250
154
Used by UniBasic
REMOVE statements.
{
@TM
251
155
Text Mark
|
@SM
252
156
Subvalue Mark
}
@VM
253
157
Value Mark
~
@FM
254
158
Field Mark
(unprintable)
@RM
255
159
Record Mark
Delimiter
Symbol
UniData Language Group Delimiters
Note: English is included in all language groups, because it is commonly used as a
business and technical language. The UniData language name is English_G2 in
Group 2, to distinguish it from English in Group 1.
1-5 UniData International
Language Group ID
Seven of the nine UniData delimiters have consecutive decimal values. The
escape sequence mark is any unused character in a code page. A language
group is identified by the record mark (@RM), print-at character
(@PRINT_AT) and the NULL character. These values are separated by a slash
(for example, 255/192/129 for Language Group 1, and 159/130/129 for
Language Group 2).
UniData does not support conversion of characters to printable characters.
These are characters CHAR(32) through CHAR(127).
The record mark (@RM) you specify as the first delimited value in the
language group determines the six consecutive characters preceding the
character representing the record mark which UniData reserves for use,
along with the specified record mark,.The other six characters represent the
field mark (@FM), the value mark (@VM), the subvalue mark (@SM), the text
mark (@TM), and two characters which UniBasic uses in the REMOVE
statement. You should take this into consideration when creating a language
group. Values for the print-at (@PRINT_AT) character and the NULL
character should not overlap with the seven reserved characters determined
by the character you specify as the record mark.
Group #
udtlang Name
Language Group ID
Group 1
English (US, UK)
255/192/129
Group 2
Some Multi-byte
languages
159/130/129
Japanese (EUC)
French (ISO8859-1)
English_G2 (English)
Group 3
Simplified Chinese
20/31/30
English_G3
UniData Language Groups
1-6
UniBasic Programming
Part of the UniData internationalization process is taking the ASCII values
out of the program code and replacing them with the corresponding
@variables listed above. In any UniBasic programs use the @variables for
record marks rather than the ASCII values, so that the marks can be
converted to another language group. The @variables are runtime values, so
they will return correct information regardless of the language in which you
run UniData.
Example
The following line of a BASIC program assigns an ASCII value for the value
mark:
EQU VM TO CHAR/253
In UniBasic, this line should be written as follows:
EQU VM TO @VM
Date, Numeric, and Currency Formats
Different countries use different conventions to display time, date, numbers,
and monetary signs. UniData International provides defaults for these
conventions, which you can change individually using ECL commands. To
change any of these default formats during an individual session, see the
section on ECL commands in Chapter 3, “Chapter 3: Customizing UniData
International.” UniData uses the following defaults.
English
French
Japanese
Date
MM/DD/YY
DD/MM/YY
YYYY/MM/DD
Numeric
999,999.00
999.99,00
999,999
Currency
$9,999.00
F9.999,00
¥9,999
Default Convention Formats
1-7 UniData International
Note: If UniData is started in English, and you change the language to French using
SET.LANG, UniData will run in French until the end of that UniData session.
When you exit the UniData session and start another UniData session, UniData
starts in the language defined by the LANG environment variable set at the operating
system level.
1-8
Language Message Files
UniData stores message files for each language in the directory udthome/sys
(for example, udthome/sys/FRENCH.MSG) on UniData for UNIX, or
udthome\sys on UniData for Windows Platforms. These files contain the error
messages for UniData, plus the DEFAULTS record for region-specific data.
UniData uses the message file appropriate to the language of your UniData
session.
Language Message Default Record
Within each language message file is the DEFAULTS record. This record
contains region-specific data that you can configure. UniData reads this
information when you start a session. The specifications in this record take
priority over the operating system locale categories. The example shows the
actual FRENCH.MSG DEFAULTS record. If you want to change any of the
default information, see “Editing the DEFAULTS Record” in Chapter 3,
“Chapter 3: Customizing UniData International.”
.},}$}1
DIMANCHE}LUNDI}MARDI}MERCREDI}JEUDI}VENDREDI}SAMEDI
JAN}FEV}MAR}AVR}MAI}JUN}JLT}AOU}SEP}OCT}NOV}DEC
PRINTEMPS}ETE}AUTOMNE}HIVER
Y}N}Q
END
~
~
.
.
“/tmp/__ED15319” 7 lines, 147 characters
If the DEFAULTS record contains no information for a language, UniData
uses the operating system defaults.
Error Messages
UniData International stores error messages in the language message files.
Each language has error messages translated into that language.
1-9 UniData International
Customization
You can customize the DEFAULTS, which contains the days of the week and
names of months, and so forth. You can also customize ECL commands and
keywords into language-specific synonyms. See Chapter 3, “Chapter 3:
Customizing UniData International,” to learn how to customize default
records, keywords, and commands.
1-10
General Rules
The following is a list of provisions to keep in mind when using UniData
International:
1-11 UniData International

You must stop and restart UniData in order to switch language
groups.

You can change from one language to another language in the same
language group during a UniData session.
Definitions, Acronyms, Abbreviations
The following terms and concepts are used throughout this manual.
Term
Definition
character set
A set of alphabetic and other characters used to construct
the words and other elementary units of a natural
language.
CJK writing system
An ideographical character-based writing system. It is
named after the three languages, Chinese, Japanese and
Korean, that use this writing system.
code page
A mapping of 256 control and display characters. ASCII
and EBCDIC are two common examples of code pages.
ISO8859-1 (also known as Latin-1) is another.
double-byte character
A 16-bit representation or encoding of a character.
ECL - Environment
Control Language
The UniData Environment Control Language; provides
the commands necessary to build and maintain a
database.
EUC
Extended UNIX Code. Provides operating system support
for multibyte character sets; single byte and multibyte
characters can be mixed.
ISO
International Standards Organization.
I18N
Industry standard, abbreviated English reference to
internationalization. There are 18 letters between “i” and
“n” in the word internationalization.
language group
The UniData language categorization. UniData requires
nine 8-bit codes for special use. All languages in the same
group use the same codes from their code page as UniData
delimiters.
NLS—National
Language Support or
Native Language
Support
NLS is part of the host operating system that provides
international support with tools and libraries to
internationalize applications.
single byte character
An 8-bit encoding or representation of a character.
Definitions
1-12
Term
Definition
UniBasic
The UniData application programming language.
UniData SQL
The UniData extended implementation of the SQL
(Structured Query Language).
VOC
Abbreviated reference to the vocabulary file. When you
create a UniData file, UniData creates an entry in the VOC
file, with the exception of indexed files.
Definitions (continued)
1-13 UniData International
Chapter
Chapte 2: Language
Configuration
Starting UniData in a Language Group
.
2
.
.
.
.
.
.
.
.
.
2-3
UniData installs in English and must be configured to run in another
language. This chapter explains how to use the language configuration script
to change language groups and start UniData in a different language. The
concept of language groups is important here. UniData reserves nine
delimiters as record marks, and languages that share the same set of
delimiters can be classified in the same language group. For instance, French
and Japanese are part of UniData Language Group 2, although the languages
are very different.
English is included in all language groups, because it is commonly used as a
business and technical language. The UniData language name is
“English_G2” in Group 2. In Group 1 it is simply “English.”
Language groups are discussed in detail in Chapter 1, “Chapter 1: Introduction to UniData International.”
Before beginning the UniData language configuration, you:
2-2 UniData International

Must have root privileges on UniData for UNIX for Administrator
privileges on UniData for Windows Platforms

Should have some knowledge of locale concepts
Starting UniData in a Language Group
Since UniData installs in Language Group 1, which includes only American
and British English, you need to run the configuration script if you want to
run UniData in another language. French and Japanese are currently
supported, and are both in Language Group 2.
Note: You do not need to run the configuration if you always operate in English. You
should run it only once if you will use only one of the languages in Language Group
2. For instance, if you use UniData in Japanese, French, or English, you never need
to change back to Language Group 1, which includes only English. You can change
languages within the same language group at any time. See the SET.LANG
command later in this manual for more information.
To start UniData in a different language group, you must be a superuser (root) on
UniData for UNIX or Administrator on UniData for Platforms.
Follow these steps to change the language group and start Unidata:
1.
Check for Users
Users must be logged off UniData, so you can stop all UniData
processes. Enter the listuser command. If there are users listed on the
system have them log off now. If there are no current users, you can
proceed.
# listuser
Licensed(UDT+CP)/Effective
(
32 + 32
UDTNO USRNBR
2.
) / 64
UID USRNAME
Udt
Sql
iPhtm
Pooled
Total
0
0
0
0
0
USRTYPE
TTY
IP-ADDRESS
TIME
DATE
Stop UniData
You must stop UniData before you can execute the language
configuration script. From the udtbin directory, execute ./stopud.
# ./stopud
Using UDTBIN=/disk1/ud73/bin
SM stopped successfully.
CLEANUPD stopped successfully.
SBCS stopped successfully.
SMM stopped successfully.
Unidata R7.3 has been shut down.
#
2-3
3.
Verify LANG Setting
The language environment variable, LANG, must be set to the same
language that you will use to start UniData. Since you are probably
working with other internationalized software, LANG may already
be set correctly. The LANG setting is based on locale.
Note: See Appendix A, “UniData and UNIX Locale,” in this manual for more
information on UniData and locale. See your host system documentation for specific
information.
If your system is running in your local language, LANG is probably
already set correctly. The “C” in LANG=C in the following example
stands for English and is the default value on most platforms,
according to the International Standards Organization’s “C”
specifications. Check your current environment for the LANG
setting.
4.
Setting the LANG Environment Variable
If your LANG environment variable is not set correctly, use the
appropriate command (such as setenv on UniData for UNIX) to
change it.
You do not need to use the entire locale name. For instance, in the
locale list, French is listed as fr_FR.iso88519. You can use simply
fr_FR.
The following example, taken from UniData for UNIX, changes the
LANG environment variable in the Bourne or Korn shell:
$ LANG=fr_FR; export LANG
$ LANG=Ja_JP; export LANG
2-4 UniData International
To set the LANG environment variable on UniData for Windows
Platforms, from the Start menu, click Control Panel, then doubleclick System. A window similar to the following example appears:
2-5
Click Advanced system settings, tab, then click Environment
Variables. The Environment Variables dialog box appears, as
shown in the following example:
Under System variables, click New. In the Variable name box, enter
“LANG”. In the Variable value box, enter the language group.
2-6 UniData International
5.
Execute the udtlangconfig Script
The udtlangconfig script completes the following tasks:

Changes the language group from one language group to
another.

Converts existing data using the convmark command. This
checks and converts the files in udthome/sys and udthome/demo
on UniData for UNIX and udthome\sys and udthome\demo
directories for the special system delimiters reserved for
UniData. (Convert your own data files with the convmark
command, described later in this chapter.)

Starts UniData in the language you specify.
Note: Language group numbers correspond to the record mark value (@RM), print
at value (@PRINT_AT), and the null value.
From the system-level prompt, enter udtlangconfig to access the
UniData language configuration script. This configuration script
prompts you for the information needed to start UniData in your
local language.
The next example shows the entire udtlangconfig process. The text
shown in bold type indicates the information you have to enter. In
the section that prompts you to enter the language, UniData sets the
default to match the LANG setting in your operating system. In this
example, the LANG is set for French.
Note: You must be superuser (root) on UniData for UNIX or Administrator on
UniData for Windows Platforms, and be in the udtbin directory to execute
udtlangconfig.
# udtlangconfig
Starting configuration of UniData RDBMS system.
The following prompts have the default answers in brackets [],
press Enter to accept these answers.
Using UDTBIN=/disk1/ud73/bin
WARNING: 'stopud -f' will stop the Unidata System with force.
This may not guarantee the consistency of the database files.
2-7
Would you like to continue?(y/n) [n]
y
SM stopped successfully.
CLEANUPD stopped successfully.
SMM stopped successfully.
SBCS stopped successfully.
Unidata R7.3 has been shut down.
Please select the appropriate language from the list below:
Language
Locale
-----------------------------ENGLISH
C
ENGLISH
en_US
ENGLISH en_US.UTF-8
ENGLISH_G2
C
ENGLISH_G2
en_US
ENGLISH_G2 en_US.UTF-8
JAPANESE
ja
FRENCH
fr
ENGLISH_G3
C
ENGLISH_G3
en_US
ENGLISH_G3 en_US.UTF-8
GB18030
C
GB18030
en_US
-----------------------------Please enter language from above list [FRENCH]:
FRENCH
Input complete, UniData processing...
Using UDTBIN=/disk1/ud73/bin
All output and error logs have been saved
to /disk1/ud73/bin/saved_logs directory.
SMM is started.
SBCS is started.
CLEANUPD is started.
SM is started.
UniData R7.3 has been started.
You now have completed the configuration process.
This is the end of the configuration process.
2-8 UniData International
6.
Convert Additional Data
You may need to convert data in other accounts if you have been
using a previous version of UniData in English, or if your data files
contain the delimiters reserved by UniData.
Use the convmark command to convert all UniData files to conform
to the language group. This tool checks and converts your data for
the system delimiters reserved by UniData.
Syntax:
convmark [-t] language_group_ID [path1 [path2 . . . ]]
When you enter convmark without an argument, UniData returns a
usage statement, giving the syntax and possible arguments. The
following table shows the arguments.
Parameters
Description
-t
Returns the number of marks need to be
converted, but does not convert them.
language_group_ID
Language group numbers correspond to the
record mark, escape sequence, and the null
value:
path 1 [path 2. . .]
■
159/130/129 French, Japanese, and English
■
255/192/129 English
■
30/31/30 Simplified Chinese and English
Specifies the full path to the files to convert.
convmark Parameters
You must be in udthome to convert the UniData files. Enter convmark
and the Language Group ID for the language group you want to use.
The convmark command converts all necessary files in a directory, or
you can specify particular files in a directory, as shown in the next
examples. If your data contains delimiters needing conversion,
convmark converts them to marks for your language group. The -t
option notifies you of files needing conversion, but does not convert
them.
2-9
Language Group ID
Seven of the delimiters have consecutive decimal values. The escape
sequence mark can be any unused character in a code page. A language
group is identified by its record mark, print-at character, and the NULL
character, separated by a slash (for example, 255/192/129 for Language
Group 1, and 159/130/129 for Language Group 2).
Group #
udtlang Name
Language Group ID
Group 1
English (US, UK)
255/192/129
Group 2
Japanese (EUC)
159/130/129
French (ISO8859-1)
English_G2
(English)
Group 3
Simplified Chinese
20/31/30
English_G3
UniData Language Groups
2-10 UniData International
Note: Language group numbers correspond to the record mark value (@RM), print
at value (@PRINT_AT), and the null value.
When you use convmark without an argument, UniData returns a
usage statement, as shown in the following example:
% convmark
Usage: convmark [-t] <new group ID> [<path1> [<path2> ...]]
When you enter convmark with -t and the new language group ID,
UniData searches all files in the directory and returns the number of
files that need to be converted, as shown in the following example:
% convmark -t 159/130/129
.
.
.
./include/udtconfig.old: not a UniData file
./include/udtconfig.bak: not a UniData file
127 UniData file(s) need conversion.
2 UniData file(s) contain new marks value(s).
Use convmark with the new language group ID to convert all files in
the current directory:
% convmark 159/130/129
.
.
.
./include/udtconfig.old: not a UniData file
./include/udtconfig.bak: not a UniData file
127 UniData file(s) were converted successfully.
The next example shows convmark with the -t option. This option
returns the number of files that need to be converted.
% convmark -t 159/130/129 demo lib
.
.
.
1 UniData file(s) need conversion.
If you do not convert all the files in the udthome directory, UniData
may not start or run correctly.
2-11
1.
Recompile UniBasic Programs
You must recompile UniBasic programs if the programs:

Were compiled in UniData International Version 3.3.2i on
UniData for UNIX.

Were compiled in a version of UniData prior to 4.0 and you are
using a language group other than Group 1 on UniData for
UNIX.

Contain any ASCII values that are reserved by UniData for
system marks, such as CHAR(254), and you are using a language
group other than Group 1. These ASCII values must be changed
to use UniBasic @variables. For example, you must change
CHAR(254) to @FM and then recompile.
Warning: If you do not modify and recompile your UniBasic programs to correct the
previous conditions, UniData may give incorrect results when you run your
UniBasic programs.
For information on compiling UniBasic programs, see Developing
UniBasic Applications.
2.
Enter a UniData Session
Change directories to the demo account and start a UniData session
with the udt command:
% udt
The following screen appears:
UniData Release 7.3 Build: (6048)
(c) Rocket Software, Inc. 1085-2012
All rights reserved.
Current UniData home is /u2/ud73
Current working directory is /u2/ud73/demohome\claireg.
:
UniData is now running in the language group and the language you
specified.
2-12 UniData International
Chapter
Chapter 3: Customizing UniData
International
Editing the DEFAULTS Record . . . . . . . . . .
Adding a Language to a Language Group . . . . . .
Starting UniData SQL in a Local Language . . . . . .
UDT.OPTIONS 53
U_PMOD_THROWAWAY . . . . . . . . . .
Using Menus to Translate VOC Keywords . . . . . .
Sorting Order . . . . . . . . . . . . . . . .
Adding a Record to the COLLATIONS File . . . . .
Pointing to a New Record in the Language Message File
.
.
.
.
.
.
.
.
.
3-3
3-5
3-11
.
.
.
.
.
.
.
.
.
.
. 3-12
. 3-13
. 3-15
. 3 -16
. 3 -18
3
This chapter describes how to use various tools, including ECL commands,
and UniBasic commands to customize UniData International for use in your
region. This chapter includes the following procedures to customize and add
to your UniData International environment.
3-2 UniData International

Editing the DEFAULTS Record

Adding a Language to a Language Group

Adding a Language Group

Starting UniData SQL in a Local Language

UDT.OPTIONS 53 — Turns on or off the use of throwaway keywords

Using Menus to Translate VOC Keywords

Creating a custom COLLATIONS file
Editing the DEFAULTS Record
You can use any editing tool to change the defaults for the localized message
files. Any change you make in the language message file is saved for future
UniData sessions. You can change any attribute to display and print
differently. For example, you may want the days of the week to appear as
abbreviations, so Monday becomes Mon., Tuesday becomes Tues., and so
forth.
Warning: Keep in mind that when you change the names of any of these attributes,
the attributes still refer to the original information. Be careful what you change in
this file, because you see this information every time UniData displays or prints
headers that include dates, currency, and so on.
The language message files are located in the udthome/sys directory on
UniData for UNIX and udthome\sys on UniData for Windows Platforms.
From the UniData prompt, enter an editor and the name of the DEFAULTS
record you want to edit. This example shows the FRENCH.MSG file.
:ED FRENCH.MSG DEFAULTS
.},}FPOST}1
DIMANCHE}LUNDI}MARDI}MERCREDI}JEUDI}VENDREDI}SAMEDI
JAN}FEV}MAR}AVR}MAI}JUN}JLT}AOU}SEP}OCT}NOV}DEC
PRINTEMPS}ETE}AUTOMNE}HIVER
Y}N}Q
END
.
.
.
“/tmp/__ED17400” 7 lines, 147 characters
The following is an example of the DEFAULTS record in the English language
message file.
,}.}$}0
Sunday}Monday}Tuesday}Wednesday}Thursday}Friday}Saturday
January}February}March}April}May}June}July}August}September}Octo
ber}November}December
Winter}Spring}Summer}Autumn
Y}N}Q
END
.
.
.
“/tmp/__ED17400” 7 lines, 190 characters
3-3
Each value within a multivalued attribute is separated by a brace. The
following table describes each attribute in the MSG DEFAULTS record.
Attribute
Description
1
Contains the thousand mark delimiter, the decimal delimiter, the
currency sign, and the date format. European format (DD/MM/YY) =
1. United States format (MM/DD/YY) = 0.
2
Contains the name of an alternative message file (optional).
3
Contains the names of the days of the week starting with Sunday. You
can change these names to abbreviations.
4
Names of the months in the year starting with January. You can change
these names to abbreviations.
5
Names of the quarters or seasons in the year (Spring, Summer, Autumn,
Winter).
6
Contains letters displayed for YES, NO, and QUIT. You can change these
characters to characters that you recognize for these words. A French
user may want to change the letter Y to O for “oui”, keep N for “non”
and change Q to F for “fin”.
DEFAULTS Record Attribute Descriptions
The UniData ECL commands that set run time values for the defaults take
priority over the DEFAULTS file in a UniData session. These commands are
as follows:

DATE.FORMAT

SET.MONEY

SET.DEC

SET.THOUS
For example, if you use SET.MONEY to change the monetary sign to the
dollar sign ($) for your current French UniData session, the default is still set
to the Franc sign in the FRENCH.MSG DEFAULTS file. When you start
another session, the Franc sign will appear as the monetary sign.
For more information on the ECL commands, see Chapter 4, “Chapter 4:
Commands Reference.”
3-4 UniData International
Adding a Language to a Language Group
You can add a language to a language group as long as all languages in the
group use the same delimiters for UniData delimiters. The UniData system
file udthome/sys/LANGGRP on UniData for UNIX and
udthome\sys\LANGGRP on UniData for Windows Platforms identifies
language groups. Adding a new language to an existing language group
requires editing the UniData LANGGRP file. The following items are
optional:

UNIX locale support

Translated message files
Note: If you are adding a multibyte character set, refer to Chapter 5, “Chapter 5:
Multibyte Language Reference” for step-by-step instructions.
Check for Users
1.
Users need to log off the system so you can stop all UniData
processes. Enter the listuser command to determine if any users are
on the system.
# listuser
Licensed(UDT+CP)/Effective
(
32 + 32
UDTNO USRNBR
2.
) / 64
UID USRNAME
Udt
Sql
0
USRTYPE
0
TTY
iPhtm
Pooled
0
0
IP-ADDRESS
Total
0
TIME
DATE
Stop UniData
Execute stopud from the udtbin directory:
# stopud
3-5
3.
Edit the LANGGRP File
Use any text editor to add the language and locale to the LANGGRP
file located in udthome/sys on UniData for UNIX or udthome\sys on
UniData for Windows Platforms. The following example adds the
Spanish udtlang, locale and description to Language Group 2:
# vi LANGGRP
# UniData language group file
BEGIN
255/192/129
# Language group 1
ENGLISH
ENGLISH_UK
C
english
# US English
# UK English
END
BEGIN
159/130/129
# Language group 2
ENGLISH_G2
JAPANESE
FRENCH
SPANISH
C
japanese.euc
french
es_ES
#
#
#
#
Group 2 English
EUC Japanese
French
Spanish
END
4.
Set Up Message File
UniData cannot operate in the new language unless a message file
exists. From the system-level prompt, copy the English message file
or other message file in the language group. You must translate the
contents of this to the new language. The message file name for each
language is the UniData language name concatenated to .MSG. See
the LIST.LANGGRP command in Chapter 4, “Chapter 4: Commands
Reference,” for more information about udtlang names. The following example shows how the English_G2.MSG file is copied and
named SPANISH.MSG:
% cp ENGLISH_G2.MSG SPANISH.MSG
3-6 UniData International
5.
Set the UDT_LANG Environment Variable
If your operating system does not have a locale setting for the new
language, set the environment variable UDT_LANG to the new
language. The following example, taken from UniData for UNIX,
sets UDT_LANG to SPANISH, then displays the environment
variables by executing the UNIX env command:
% setenv UDT_LANG SPANISH
% env
TERM=xterm
SHELL=/bin/csh
.
.
.
LANG=C
UDTHOME=/usr/ud73
UDTBIN=/usr/ud73/bin
UDT_LANG=SPANISH
3-7
The next example illustrates how to set the UDT_LANG
environment variable on UniData for Windows Platforms. From the
Start menu, click Control Panel, then double-click System. A
window similar to the following appears:
3-8 UniData International
Click the Advanced tab, then click Environment Variables. A dialog
box similar to the following example appears:
Under System Variables, click New. In the Variable name box, enter
“UDT_LANG.” In the Variable value box, enter the language, as
shown in the preceding example.
3-9
6.
Start UniData
From the udtbin directory, start UniData:
# startud
Using UDTBIN=/disk1/ud73/bin
All output and error logs have been saved
to /disk1/ud73/bin/saved_logs directory.
SMM is started.
SBCS is started.
CLEANUPD is started.
SM is started.
UniData R7.3 has been started.
:
7.
Start a UniData Session
Change to the demo directory and start a UniData session:
Your session starts in the new language. Future sessions will also
start in the designated language, until you change UDT_LANG or
use SET.LANG to change it for a particular UniData session.
3-10 UniData International
Starting UniData SQL in a Local Language
Enter SQL to start UniData SQL regardless of your language group setting:
:SET.LANG FRENCH
Langage 'FRENCH' assigné !
:SQL
sql>
UniData SQL statements must be entered in English, but error messages are
drawn from the message file of the language and are therefore displayed in
the local language. The next example shows an error message given in
French:
a.
:SQL
a.
sql> SELECT * FROM COURSES;
a.
Pas de privilège sur le fichier COURSES!
This message in English is: No privilege on file COURSES.
3-11
UDT.OPTIONS 53
U_PMOD_THROWAWAY
Use UDT.OPTIONS 53 when a UniQuery statement in a local language
contains throwaway keywords.
Note: This option affects ECLTYPE P only.
In the following example, the French OU is a throwaway keyword and a
synonym for the English OR. The AVEC keyword is a synonym for the
English keyword WITH. N and M are any VOC entry categories:
Language
Text
English
LIST VOC WITH F1 = “N” OR WITH F1 = “M”
French
LISTEZ VOC AVEC F1 = “N” OU AVEC F1 = “M”
Throwaway Keywords with UDT.OPTIONS 53
The VOC file entry for the French OU looks like this:
@ID:OU
f1:U
f2:OR
ON
When this option is on, UniData searches for the keyword in the VOC file
before checking a built-in UniData vocabulary table. If UniData finds the
word in the VOC file, the VOC entry identifies it as a synonym for the English
keyword. Therefore, UniData recognizes the French OU as a synonym for the
English throwaway keyword OR.
OFF
When this option is OFF, UniData does not check the VOC file first. Instead,
it checks only the built-in UniData vocabulary table. Therefore, UniData does
not recognize OU as a synonym for a throwaway English keyword.
3-12 UniData International
Using Menus to Translate VOC Keywords
You can further localize UniData by translating ECL keywords through the
MENUS utility by changing the names of commands in the VOC file. For
more information about the VOC file, see Using UniData.
You can display a list of VOC records with the LIST VOC command.
1.
To change a name for a VOC item, enter MENUS from an ECL
prompt:
:MENUS
The following MENU Maintenance screen appears and prompts you
to choose a selection:
MENU Maintenance
1=
2=
3=
4=
5=
6=
7=
8=
9=
10=
11=
12=
13=
2.
Enter/Modify
Enter/Modify
Display
Display
Enter/Modify
Enter/Modify
Display
Display
Display
Print
Print
Print
Enter/Modify
18:17:43 Feb 09 1998
a MENU
a formatted MENU
a summary of all MENUs on a MENU file
the contents of a MENU
a VOC MENU selector
a VOC stored sentence item
all MENU selector item on the VOC file
all stored sentence items on the VOC file
the dictionary of a file
a summary of all MENUs on a MENU file
the contents of a MENU
the dictionary of a file
a VOC stored paragraph item
Enter the number of the item you want, in this case number six.
which would you like? (1 - 13)=6
When you select number six, the system prompts you for a sentence
name. Enter the name of the VOC record to change. A list of four
elements appears, as shown in the following example:
Sentence Name = UPDATE
1 sentence name=UPDATE
2 type=S
3 description=QLV
4 sentence=UPDATE
3-13
3.
Choose attribute 1, sentence name, and change the name to the
appropriate translated name. Repeat this step for all VOC item
names that you wish to translate.
Change=1
name=METTRE_A_JOUR
4.
When you display a list of all the stored sentence names (number 8
in the MENUS list), UniData displays the new names.
For more information on MENUS, see Using UniData.
3-14 UniData International
Sorting Order
The UniData COLLATIONS file defines the default sorting order for
UniQuery reports. This file resides in udthome/sys on UniData for UNIX or
udthome\sys on UniData for Windows Platforms. You can add records in
COLLATIONS and change that record’s attribute order to reflect the sort
order you want. Then add an attribute to the language message file
DEFAULTS record, pointing to that record to the COLLATIONS file. This
section describes how to add a record in the COLLATIONS file, how to point
to that record in the message file, and how a report displays with these
changes.
Note: The sort order indicated in the COLLATIONS file affects only singlebyte
languages. It is not relevant to multibyte languages.
A record in the COLLATIONS file can contain up to 258 attributes, which
contain the hexadecimal representation of characters in ASCII order. The first
two attributes in the file are reserved for comments. You can create or modify
the remaining 256 attributes. The ASCII and HEX character codes are listed
in the UniBasic Commands Reference. Use this as a reference when modifying
a COLLATIONS record.
The following is a graphical representation of the files, records, and attributes
that together determine the sort order. The COLLATIONS file shows a
customized record called CUSTOM.SORT. The ENGLISH.MSG file shows
CUSTOM.SORT as attribute 7, pointing to the customized record in
COLLATONS.
COLLATIONS
TESTING
0
CUSTOM.SORT
attr 1: C 1
attr 2:* This is a collation table.
attr 3: 00
.
.
.
ENGLISH.MSG
DEFAULTS
attr
attr
attr
attr
attr
attr
attr
1:
2:
3:
4:
5:
6:
7:
, . $ 0
Sunday Monday Tuesday ...
January February March April ...
Winter Spring Summer Autumn
Y N Q
CUSTOM.SORT
attr 258:
3-15
Note: The default COLLATIONS file contains record 0, which is reserved for
internal UniData use. You should not modify this record.
Adding a Record to the COLLATIONS File
You must log on as root on UniData for UNIX or Administrator on UniData
for Windows Platforms to edit the COLLATIONS file.
An easy way to modify the UniData sorting order is to copy an existing
COLLATIONS record and modify it. The following example shows the
contents of the COLLATIONS file. Record 0 contains the default collation
order. TESTING is a copy of record 0 with the sort order changed.
LIST COLLATIONS 12:10:01 Apr 07 2010 1
COLLATIONS
TESTING
0
2 records listed
The next example shows how to copy the record TESTING to a new record,
CUSTOM.SORT:
:COPY FROM COLLATIONS TO COLLATIONS TESTING, CUSTOM.SORT
1 records copied
The attributes in the records in COLLATIONS are in hexadecimal format.
Each alphanumeric combination stands for a character. The following table
shows the default sorting order that UniData uses. Notice that the order is
alphabetical, from A through F.
Character
HEX
A
41
B
42
C
43
D
44
E
45
F
46
Default COLLATIONS Order
3-16 UniData International
The next table shows the order of the TESTING record in the COLLATIONS
file. The order has been changed to F through A. The character and HEX
definitions are the same, just in a different attribute order in the
COLLATIONS TESTING record.
Character
HEX
F
46
E
45
D
44
C
43
B
42
A
41
COLLATIONS TESTING Order
The next example shows the same part of the new CUSTOM.SORT record as
in the preceding tables.
Current UniData home is /disk1/ud73/.
Current working directory is /disk1/ud73/sys.
:AE COLLATIONS CUSTOM.SORT
Top of "CUSTOM.SORT" in "COLLATIONS", 258 lines, 801 characters.
*--: 66
066: 3F
067: 40
068: 46
069: 45
070: 44
071: 43
072: 42
073: 41
074: 47
075: 48
076: 49
3-17
Pointing to a New Record in the Language Message File
To point to a record in the COLLATIONS file, add the record name to
attribute 7 of the DEFAULTS record of the appropriate language message file.
In the previous section, CUSTOM.SORT was added to COLLATIONS as a
new sort record. The attributes in CUSTOM.SORT define the new sort order.
The following example shows adding the COLLATIONS record
CUSTOM.SORT to attribute 7 in ENGLISH.MSG DEFAULTS record:
:AE ENGLISH.MSG
Record ids > DEFAULTS
Top of "DEFAULTS" in "ENGLISH.MSG", 6 lines, 185 characters.
001: , . $ 0
002:
003: Sunday Monday Tuesday Wednesday Thursday Friday Saturday
004: January February March April May June July August September
October
November December
005: Winter Spring Summer Autumn
006: Y N Q
Bottom.
*--: I
007= CUSTOM.SORT
*--: FI
Filed "DEFAULTS" in file "ENGLISH.MSG".
3-18 UniData International
In the next example, the sorting order is defined by the CUSTOM.SORT
record. Notice that the first name that begins with a letter is Flash Gordon.
This is because, in CUSTOM.SORT, the letter F is the first alpha character in
the CUSTOM.SORT record. The names display in reverse order up to the
letter G. Then the sorting order is alphabetic.
LIST TAPES BY NAME NAME 11:59:02 Apr 08 2012 1
TAPES..... Tape Name...........
V8481
V6670
V1254
V8181
V996
V2001
V7456
V4951
V110
V1249
V9431
V4637
V5004
B2297
V4499
V1231
V1077
B914
V9961
V5151
Enter <New
'Round Midnight
2001
Flash Gordon
Catch 22
Citizen Kane
Blue Velvet
A Clockwork Orange
American Graffiti
Girl Friday
Gone With The Wind
Help
If...
Journey Abroad
Love Story
Psycho
Scaramouche
Sleuth
Tammy
The Stalker
To Kill A
line> to continue...
3-19
Chapter
Chapter 4: Commands Reference
DATE.FORMAT . . . .
LIST.LANGGRP . . . .
SET.LANG . . . . . .
SET.MONEY. . . . . .
SET.DEC . . . . . . .
SET.THOUS . . . . . .
UPDATE.LANG.DEFAULTS
convmark. . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4-3
4-6
4-7
4-9
4-12
4-14
4-16
4-19
4
This chapter covers UniData commands you use to change default settings
such as date, time, currency, and decimal mark. UniData’s Environment
Control Language (ECL) commands allow you to customize a UniData
session. The following commands are discussed in this chapter:

DATE.FORMAT

LIST.LANGGRP

SET.LANG

SET.MONEY

SET.DEC

SET.THOUS

convmark — a UniData system-level command which searches and
converts your data to be compatible with UniData’s system marks
Note: All of these commands, except convmark, make run time changes that affect
only the current session. When you start a new session, the settings return to the
default settings. You can store these commands in a LOGIN paragraph in the VOC
file. The paragraph executes automatically when a user enters the account. To change
the defaults, see “UPDATE.LANG.DEFAULTS” on page 4-16.
4-2
DATE.FORMAT
Syntax
DATE.FORMAT {0 | 1 | AMERICAN | EUROPEAN}
Description
The ECL DATE.FORMAT command with option 1 displays all dates in
European format (DD/MM/YY). You may also use DATE.FORMAT
EUROPEAN to achieve the same format. To reset the display to American
format (MM/DD/YY), enter DATE.FORMAT 0 or DATE.FORMAT
AMERICAN. DATE.FORMAT can be changed at any time during a UniData
session, and affects the output formats of a number of UniBasic and
UniQuery commands including the FOOTING, HEADING, DATE, and
TIMEDATE commands.
Note: DATE.FORMAT overrides the default set by the SET.LANG command.
4-3 UniData International
Example
The following example shows how to change to the American
DATE.FORMAT, then run a LIST command verifying the change. Notice that
the query results are in the MM/DD/YY format:
:DATE.FORMAT 0
:LIST CUSTOMER DATE_OUT BY.EXP DATE_OUT
.
.
.
2 01/01/94
2 01/03/94
11 03/29/94
5 03/29/94
4 04/15/94
10 04/19/94
9 04/20/94
9 04/20/94
9 04/21/94
1 04/23/94
3 04/23/94
7 04/23/94
8 04/23/94
100 04/24/94
12 04/24/94
1 04/24/94
1 04/24/94
6 04/24/94
100 04/25/94
15 04/25/94
8 04/25/94
38 records listed
4-4
The next example shows how to change to the European DATE.FORMAT,
then run a LIST command verifying the change. Both the header and the
query result formats are changed to the DD/MM/YY format:
:DATE.FORMAT 1
:LIST CUSTOMER DATE_OUT BY.EXP DATE_OUT
LIST CUSTOMER DATE_OUT BY.EXP DATE_OUT 12:33:25 04 Mar 2005 1
Cust...... Date Out
.
.
.
2 01/01/94
2 03/01/94
11 29/03/94
5 29/03/94
4 15/04/94
10 19/04/94
9 20/04/94
9 20/04/94
9 21/04/94
1 23/04/94
3 23/04/94
7 23/04/94
8 23/04/94
100 24/04/94
12 24/04/94
1 24/04/94
1 24/04/94
6 24/04/94
100 25/04/94
15 25/04/94
8 25/04/94
38 records listed
4-5 UniData International
LIST.LANGGRP
Syntax
LIST.LANGGRP
This command displays the current language group ID.
Examples
The following example shows the setting for language group 2:
:LIST.LANGGRP
Current language group ID: 159/130/129
The next example shows the setting for language group 1:
:LIST.LANGGRP
Current language group ID: 255/192/129
The following table shows the UniData language names (udtlang) and the
language group identifiers. Language group numbers correspond to the
record mark value (@RM), print at value (@PRINT_AT), and the NULL value.
Group #
udtland Name
Language Group ID
Group 1
English (US, UK)
255/192/129
Group 2
Japanese (EUC)
159/130/129
French (ISO8859-1)
English_G2
(English)
Group 3
Simplified Chinese
20/31/30
English_G3
UniData Language Groups
4-6
SET.LANG
Syntax
SET.LANG udt.lang | [CURRENT | AVAILABLE]
Description
The ECL SET.LANG command changes the language in the current UniData
language group. You can specify the language by spelling it out in uppercase
letters, or by entering the UniData language ID. Type AVAILABLE after
SET.LANG to display a list of languages from which to choose, or type
CURRENT to display the current language setting. If you enter SET.LANG
without parameters, UniData displays a usage statement.
Parameters
The following table describes the SET.LANG parameters.
Option
Description
udtlang
Specifies the UniData operating language:
ENGLISH_G2
FRENCH
JAPANESE
CURRENT
Displays the current language setting.
AVAILABLE
Displays the available language names.
SET.LANG Parameters
4-7 UniData International
Example
In the following example, the SET.LANG command without an argument
displays a usage statement. The SET.LANG AVAILABLE command displays
a list of current languages. Entering SET.LANG FRENCH selects French as
the current UniData session language:
:SET.LANG
Usage: SET.LANG <udtlang>|CURRENT|AVAILABLE
:SET.LANG AVAILABLE
ENGLISH_G2
JAPANESE
FRENCH
:SET.LANG FRENCH
Langage 'FRENCH' assigné !
UniData changes the code set, message file, date format, numeric format, and
money sign when you execute SET.LANG. This command closes the current
language message file, opens the new file, and reads the appropriate
DEFAULTS record.
The defaults for the DEFAULTS record for each language are shown in the
following table.
Variable
ENGLISH_G2
FRENCH
JAPANESE
Date
MM/DD/YY
DD/MM/YY
YYYY/MM/DD
Numeric
999,999.00
999.99,00
999,999
Currency
$9,999.00
F9.999,00
¥9,999
DEFAULTS Formats
Note: If UniData is started in English and you change the language to French using
SET.LANG, UniData will run in French until the end of that UniData session.
When you start another udt session, UniData starts in the language defined by the
LANG environment variable set at the operating system level.
4-8
SET.MONEY
Syntax
SET.MONEY sign [POST | PRE]
Description
The ECL SET.MONEY command changes the delimiter that represents the
currency sign. Use this command when you need to change the money sign
from the default set for your language. When SET.MONEY is used without
an argument, the command returns a usage statement.
The money sign follows the number in some regions, and UniData honors
this convention when the POST option is used. If POST is not set, the money
sign appears in the preceding (PRE) position.
Examples
The following example shows the result of the SET.MONEY command used
without an argument:
:SET.MONEY
Usage: SET.MONEY <money sign>
4-9 UniData International
In this example the currency sign is set to the default for ENGLISH_G2, the
dollar sign:
:SET.MONEY $
:LIST TAPES COST NAME BY COST
LIST TAPES COST NAME BY COST 17:27:46 Mar 06 2010 1
TAPES..... Tape Cost Tape Name...........
B914
$9.99
V110
$22.50
V1231
$23.00
V5004
$23.25
V1254
$23.50
.
.
.
V4637
$40.00
V2001
$44.00
V4951
$45.00
V6670
$45.00
V8181
$45.00
V996
$45.00
V8481
$65.00
V7456
$77.00
V1249
$78.00
21 records listed
Tammy
Girl Friday
Scaramouche
Journey Abroad
Flash Gordon
If...
Blue Velvet
American Graffiti
2001
Catch 22
Citizen Kane
‘Round Midnight
A Clockwork Orange
Gone With The Wind
4-10
In the next example, SET.MONEY changes the currency sign to the French
franc and is positioned following the number. The query returns the same
results as the previous example, but the currency sign is now the franc sign
(F):
:SET.MONEY FPOST
:LIST TAPES COST NAME BY COST
LIST TAPES COST NAME BY COST 10:01:02 17 AVR 2010 1
TAPES..... Tape Cost Tape Name...........
B914
9,99
V110
22,50
V1231
23,00
V5004
23,25
V1254
23,50
.
.
.
V4637
40,00
V2001
44,00
V4951
45,00
V6670
45,00
V8181
45,00
V996
45,00
V8481
65,00
V7456
77,00
V1249
78,00
21 articles listés
F
F
F
F
F
Tammy
Girl Friday
Scaramouche
Journey Abroad
Flash Gordon
F
F
F
F
F
F
F
F
F
If...
Blue Velvet
American Graffiti
2001
Catch 22
Citizen Kane
‘Round Midnight
A Clockwork Orange
Gone With The Wind
Note: To display a space between the amount and the currency sign, use an extra
space in the command line after the SET.MONEY command.
4-11 UniData International
SET.DEC
Syntax
SET.DEC character
Description
The ECL SET.DEC command changes the decimal point character for use
with particular currency. The default character is the period (.).
This command has the following restrictions:

The decimal point and thousands delimiter cannot be the same
character. For instance, when SET.DEC is set as a comma (,), the
period (.) is no longer a decimal point except in the constants in
UniBasic programs and dictionary items.

Decimal and thousand delimiters cannot be changed in the middle of
the execution of a UniBasic program.
Example
In the following example, the SET.DEC command changes the decimal
character to a comma (,):
:SET.DEC ,
4-12
The next example shows the results of a LIST statement after the decimal is
set as a comma:
LIST TAPES COST NAME BY COST 17:51:45 Mar 06 2010 1
TAPES..... Tape Cost Tape Name...........
B914
V110
V1231
V5004
V1254
V4341
V4499
...
4-13 UniData International
$9,99
$22,50
$23,00
$23,25
$23,50
$23,50
$23,50
Tammy
Girl Friday
Scaramouche
Journey Abroad
Flash Gordon
Z
Psycho
SET.THOUS
Syntax
SET.THOUS character
Description
The ECL SET.THOUS command changes the character that indicates a break
for thousands. A comma (,) is the default character.
This command has the following restrictions:

The decimal point and thousands delimiter cannot be the same
character. For instance, when SET.DEC is set as a comma (,), the
period symbol (.) loses its functionality as a decimal point except in
the constants in UniBasic programs and dictionary items.

Decimal and thousand delimiters cannot be changed in the middle of
the execution of a UniBasic program.
Examples
In the following example, the SET.THOUS command sets the thousands
break character to a period (.):
:SET.THOUS .
LIST STAFF SAL BY NAME 13:46:17 Mar 29 2010 1
STAFF..... Salary.
1
31.200
8
98.000
7
29.900
2
25.800
3
42.000
4
32.500
6
35.800
9
19.900
5
26.800
9 records listed
4-14
In the following example, the SET.THOUS command sets the thousands
break character to a comma(,):
:SET.THOUS ,
LIST STAFF SAL BY NAME 13:47:58 Mar 29 2010 1
STAFF..... Salary.
1
31,200
8
98,000
7
29,900
2
25,800
3
42,000
4
32,500
6
35,800
9
19,900
5
26,800
9 records listed
4-15 UniData International
UPDATE.LANG.DEFAULTS
Syntax
UPDATE.LANG.DEFAULTS
Description
This command updates the language DEFAULTS record in the language
message files. UniData saves the changes you make for future UniData
sessions. Follow this procedure to execute this command.
1.
To access the DEFAULTS record, enter UPDATE.LANG.DEFAULTS
from the UniData prompt:
:UPDATE.LANG.DEFAULTS
2.
The screen prompts you for the name of the language message file
that you need to update. The following example requests the
ENGLISH_G2.MSG file. UniData displays a data record, listing the
attributes and their current values.
:UPDATE.LANG.DEFAULTS
<udtlang>.MSG=?ENGLISH_G2.MSG
MSG.DEFAULTS RECORD ID==>DEFAULTS
3
4
5
6
7
0 @ID=DEFAULTS
1 ALTERNATIVE_MESSAGE_FILE=
2 COLLATION=
==>THOU_DEC_MON_DATEFORMAT
==>DAYS_OF_WEEK
==>MONTHS
==>SEASONS
==>PROMPTS
FROM 3 to 7 ARE MULTI VALUED FIELDS SCREENS.
Enter 'DELETE' 'UNCHANGE' 'QUIT' or NUMBER to change
Change=
4-16
Attribute
Description
@ID=
Name of the message file. We do not
recommend changing the name of this
file.
ALTERNATIVE_MESSAGE_FILE
Alternative message file. There is no
default alternative message file.
UDTLANGS
Available languages in the current
language group.
CURRLANG_THOU_DEC_MON
_DATEFORMAT
Current language number, thousand
delimiter, decimal delimiter, money
sign and date format.
DAYS_OF_WEEK
Days of the week.
MONTHS
Months of the year.
SEASONS
Seasons of the year.
PROMPTS
Prompts for yes (Y), no (N), and
question (Q).
DEFAULTS Record Attributes
Once you enter an attribute number, you have the option to insert,
delete, or change its value. If you enter an attribute and decide not to
make a change, enter “UNCHANGE.” UniData returns to the main
menu. To exit the menu, enter “QUIT.”
4-17 UniData International
3.
Choose the number of the attribute you wish to change, or choose
one of the options at the bottom of the screen. The next example
shows how to change the PROMPTS default from “Y” for “yes” to
“O” for “oui.”
UniData prompts for the line number, which is 1 in the example, then
prompts for the column, which is also 1. The Y_N_Q line is
displayed. You can change all of the prompts by following this
format, but, for this example, only the Y is changed to O. When you
press ENTER, UniData displays all of the values, and you can see the
change you just made.
Change=7
MSG.DEFAULTS RECORD ID==>
MULTI VALUED FIELDS SCREEN
Column No.
1
No.
PROMPTS
1
Y
2
N
3
Q
4
Change which line=1
Enter 'DELETE'/ 'INSERT' /Column number to change=1
Y_N_Q=O
Change which column=
MSG.DEFAULTS RECORD ID==>
Column No.
1
No.
PROMPTS
1
O
2
N
3
Q
4
Tip: You can also change the language DEFAULTS record using any system editor.
See “Editing the DEFAULTS Record” in Chapter 3, “Chapter 3: Customizing
UniData International.”
4-18
convmark
Syntax
convmark [ -t] language_group_ID [path1 [path2 ...]]
This tool checks for and converts the ASCII characters reserved for use as
UniData delimiters. You need to run convmark when you change language
groups from Group 1 to Group 2. To run UniData in Language Group 2, run
this command after you install or update UniData. This assures that your
data is compatible with the current language configuration.
The convmark command recursively converts all files in a directory, or
converts given files individually.
For specific instructions on using convmark see Chapter 2, “Chapte 2:
Language Configuration,” in this manual.
Parameters
The following table describes the parameters for convmark.
Parameter
Description
-t
Returns how many marks need to be converted, but does
not convert them.
(language_group_ID)
Language group IDs correspond to the record marks,
escape sequence, and the null value:
[(path 1) (path 2). . .]]
■
159/130129 French, Japanese and English
■
255/192/129 English
■
20/31/30 Simplified Chinese and English
Specifies the full path to the directory or files to convert.
convmark Parameters
4-19 UniData International
Chapter
Chapter 5: Multibyte Language
Reference
Limitations and Exclusions. . . . . .
Storing Characters. . . . . . . . .
Displaying Characters . . . . . . .
Multibyte Configuration File . . . . .
Adding a Multibyte Language to UniData
UniBasic Multibyte Support . . . . .
Modified Functions and Commands .
Singlebyte Functions . . . . . .
Multibyte Functions. . . . . . .
BYTELEN. . . . . . . . . . . .
CHARLEN . . . . . . . . . . .
DISPLAYWIDTH . . . . . . . . .
ISMB . . . . . . . . . . . . .
LEN. . . . . . . . . . . . . .
MBLEN . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5-3
.
5-4
.
5-5
.
5-6
.
5-7
. 5-15
. 5 -15
. 5 -17
. 5 -18
. 5-19
. 5-20
. 5-21
. 5-22
. 5-23
. 5-24
5
Multibyte language handling poses unique problems in terms of computer
display and storage. The first part of this chapter explains how UniData
International stores and displays multibyte characters and strings. Included
is a multibyte configuration table to help you understand how UniData
International handles multibyte processing.
The second part of this chapter provides UniBasic functions to aid developers
working in languages using multibyte character sets.
Note: The examples used in this chapter are graphical representations of multibyte
character strings.
5-2 UniData International
Limitations and Exclusions
UniData does not support all character sets or multibyte encoding at this
time. The following limitations and exclusions exist in this version of
UniData International:

LIST.LABEL — lines do not wrap properly if the label contains more
than one column when using the Japanese Half Katakana character
set.

SORT.LABEL — lines do not wrap properly if the label contains more
than one column when using the Japanese Half Katakana character
set.

Byte Limitation — maximum number of 4 bytes per character.

Code Range Limitation — maximum code range of four for each
byte.

Code Set Limitation — maximum of four code sets for each encoding
method.

ASCII Code — is a subset of the multibyte encoding system.

Multibyte Code Value Range — cannot include ASCII code range.
5-3
Storing Characters
Characters are stored in UniData according to the encoding method of your
application.
The following example represents a string of 4 characters. The numbers
below each character indicates the number of bytes the character contains.
The storage size for this string is 8 bytes.
Characters
Number
of bytes
5-4 UniData International
2
3
1
2
Displaying Characters
For all languages using a Latin character writing system, such as French or
English, the display width of a character always matches its internal storage
length (in terms of bytes).
CJK ideographical writing systems require multibyte code sets for language
processing. According to the EUC Kanji system for the Japanese language,
single-byte characters and two-byte characters are mixed. While a single byte
character has a display width of 1 character, a two-byte character has a
display width of either one or two characters.
This combination of character widths determines how UniData wraps text
lines. This applies to wrapping at the end of the physical display line and
wrapping under each column heading in UniQuery output. The backspace
key is a component of this issue. UniData erases the entire character behind
the cursor when you use the backspace key, regardless of the characters
display width.
5-5
Multibyte Configuration File
UniData International processes and displays multibyte character sets
through the multibyte configuration table, called MULTIBYTE.CONFIG.
Each multibyte language, or encoding system, has an entry in this file.
UniData uses this file to process, input, and display multibyte data.
UniData searches this file when you change or start a UniData session in a
different language. If there is no entry in this file, UniData assumes a singlebyte encoding method.
5-6 UniData International
Adding a Multibyte Language to UniData
Warning: You should understand the code page of any multibyte language you want
to add to UniData. You need to know the number of bytes each character takes to
display and to store. Ask your operating system vendor for details on your character
set.
Note: You must be logged on as root on UniData for UNIX or Administrator on
UniData for Windows Platforms to perform this process.
1.
Check for Users
All users must be logged off the system so that you can stop all
UniData processes. Use the listuser command for to find out if users
are currently logged on.
Licensed(UDT+CP)/Effective
( 32 + 32 ) / 64
Udt
0
Sql
iPhtm Pooled
0
0
0
Total
0
UDTNO USRNBR UID USRNAME USRTYPE TTY IP-ADDRESS
TIME DATE
2.
Stop UniData
Execute stopud from the udtbin directory:
# stopud
5-7
3.
Add an Entry to the MULTIBYTE.CONFIG File
Use vi or another editor to add an entry to the MULTIBYTE.CONFIG
file located in the udthome/sys directory on UniData for UNIX or
udthome\sys directory on UniData for Windows Platforms. The
syntax and examples follow. See your host system documentation for
the encoding detail.
Syntax:
BEGIN
# Begin entry for Language
udtlang
# udtlang name
bytes:display width:1st range,2nd range
bytes:display width:1st range,2nd range
END
# End entry for Language
# encoding 1
# encoding 2
Parameters
Each entry must follow the preceding syntax format. The following
table describes each element.
Parameter
Description
BEGIN
Start of the entry.
udtlang
udtlang name is the language name you will use for this
language.
bytes
Number of bytes required to store one character.
display width
Display width of one character.
ranges
Code range for each byte. Ranges for bytes are separated by
a comma.
END
End of the entry.
MULTIBYTE.CONFIG File Parameters
Examples
The following is an example of the MULTIBYTE.CONFIG file entry
for the Japanese EUC encoding system. Blank lines are inserted for
legibility.
5-8 UniData International
BEGIN
# Japanese EUC
JAPANESE
# udtlang name
2:2:160-255:160-255
# EUC code set 1. 2 bytes, 2 display widths.
2:1:142:160-255
display
# EUC code set 2. (half-katakana), 2 bytes, 1
3:2:143:160-255:160-255 # EUC code set 3. 3 bytes, 2 display widths
END
# Japanese EUC
The following is an example of the MULTIBYTE.CONFIG file entry
for the Chinese GB encoding system. Blank lines are added for
legibility.
BEGIN
# GB 2312, Chinese simplified
CHINESE.GB
2:2:161-254:161-254
#
#
#
#
udtlang name for GB 2312
2 bytes, 2 display widths.
first byte range: 161-254
second byte ranges: 64-126, 161-
254
END
# end of CHINESE.GB
BEGIN
# Fusheng encoding
CHINESE.FS
4:2:176-191:49-90:49-90:49-90
#
#
#
#
#
END
udtlang name for Fusheng
4 bytes, 2 display widths.
first byte range: 176-191
second-4th byte ranges: 49-90
end of CHINESE.FS
5-9
4.
Add the Language to LANGGRP
The following example adds the Chinese GB udtlang and description
to Language Group 2:
% vi LANGGRP
# UniData language group file
BEGIN
255/192/130
# Language group 1
ENGLISH
ENGLISH_UK
C
english
# US English
# UK English
C
japanese.euc
french
#
#
#
#
END
BEGIN
159/130/129
# Language group 2
ENGLISH_G2
JAPANESE
FRENCH
CHINESE_GB
Group 2 English
EUC Japanese
French
ChineseGB 2312
BEGIN
20/31/30
END
If no locale exists for the encoding method of the added language,
leave the locale name column blank in the LANGGRP file. UniData
uses the current locale in this case, and uses the information in the
MULTIBYTE.CONFIG file to process multibyte characters. For
example, if the locale is “C,” UniData looks for CHINESE_GB in the
MULTIBYTE.CONFIG table. UniData finds the entry, which
instructs UniData in processing multibyte characters for CHINESE_GB. UniData can store and retrieve data only with this
method.
5-10 UniData International
5.
Set Up the Message File
UniData searches udthome/sys on UniData for UNIX or udthome\sys
on UniData for Windows Platforms for a language message file
when you start UniData. There must be a message file with a file
name in this format: UDTLANG.MSG.
If no translated message file exits, you must copy another message
file from a language in the same language group. For example, there
is no translated message file for CHINESE.GB, so you must copy an
existing message file. The following example shows how the
English_G2.MSG file is copied and named CHINESE_GB.MSG. Now
any time an error message appears, it displays in English.
From the UNIX prompt, copy the English message file or other
message file in the language group:
% cd sys
% cp ENGLISH_G2.MSG CHINESE_GB.MSG
6.
Set the UDT_LANG
Use this variable if your system does not have a locale setting for the
new language.
Set the environment variable UDT_LANG to the new language. The
following example shows how to set UDT_LANG to CHINESE_GB
on UniData for UNIX. Use the UNIX env command (or equivalent)
to verify your change.
% setenv UDT_LANG CHINESE_GB
% env
TERM=xterm
SHELL=/bin/csh
.
.
.
LANG=C
UDTHOME=/usr/ud73
UDTBIN=/usr/ud73/bin
UDT_LANG=CHINESE_GB
%
5-11
The next example illustrates how to set the UDT_LANG
environment variable on UniData for Windows Platforms. From the
Start menu, click Control Panel, then double-click System. The
following window appears:
5-12 UniData International
Click the Advanced tab, then click Environment Variables. The
following dialog box appears:
Under System variables, click New.In the Variable value box, enter
“UDT_LANG.” In the Variable value box, enter the language, as
shown in the preceding example.
Note: Any changes to the environment that you make from the UNIX prompt are
valid only for the current UniData session. You can change your .login file if you
want future UniData sessions to use these same settings.
5-13
7.
Start UniData
You must log on as root on UniData for UNIX or Administrator on
UniData for Windows Platforms to start UniData.
From the udtbin directory, start UniData using the startud command,
as shown in the following example:
# $UDTBIN/startud
Using UDTBIN=/disk1/ud73/bin
All output and error logs have been saved
to /disk1/ud73/bin/saved_logs directory.
SMM is started.
SBCS is started.
CLEANUPD is started.
SM is started.
UniData R7.3 has been started.
:
8.
Start a UniData Session
Change directories to the demo account and start a UniData
session.Your session starts in the new language. Future sessions will
also start in the designated language, until you change UDT_LANG,
or use SET.LANG in a running session.
9.
Edit the DEFAULTS Record
Change the DEFAULTS record in the language message file if you
want to change the settings for money sign, thousand delimiter, and
so forth. You can also change the days of the week, month, and
season to the correct name in your language. See Chapter 3, “Chapter
3: Customizing UniData International,” for instructions.
5-14 UniData International
UniBasic Multibyte Support
This section summarizes UniBasic’s support of languages that require
multiple bytes to represent a single character.

Modified Functions and Commands — These functions support
multibyte languages.

Single-byte Functions — These functions support only singlebyte
languages.

Multibyte Functions — These functions are designed specifically for
multibyte language support.
Multibyte languages require that strings be recognized by character rather
than byte. These changes do not affect functionality for single-byte
languages, because, for these languages, one byte represents each character.
Modified Functions and Commands
The following table lists the UniBasic functions that have been modified to
analyze strings by character instead of byte.
Function
Comment
CHANGE
Replaces all occurrences of a substring with a string.
CHAR
Changes a numeric expression to its ASCII (American Standard
Code for Information Interchange) character string equivalent
CHARS
Changes a numeric value in an array to its ASCII character
equivalent.
COL1
Returns the column position preceding a substring found by the
FIELD function.
COL2
Returns the column position following a substring found by the
FIELD function.
CONVERT
Converts a single- or multibyte character string to another
character string.
COUNT
Returns the number of times a substring appears within a string.
UniBasic Character Recognition Functions
5-15
Function
Comment
COUNTS
Returns the number of times a substring appears within each
element of an array.
DCOUNT
Counts delimited substrings.
FIELD
Locates and returns a substring or group of substrings; treats a
string as an array, with fields delimited by any ASCII character.
See also COL1 and COL2 in this table.
FINDSTR
Determines the position of a substring in a dynamic array.
GET
Receives unprompted input from an attached line.
ICONV
Converts string or numeric data to internal representation format
based on conversion codes.
INDEX
Returns the starting position of a specified occurrence of a
substring within a string.
INPUT
Requests data from an input queue or the terminal screen.
INPUT @
Places the cursor at a specific location on the terminal screen and
requests input from the user. See the note on mask parameters
later in this chapter.
LEN
Returns the length of an expression.
LENS
Returns the length of the values within each element of a dynamic
array.
MATCH
Determines if a variable matches a specific pattern of characters or
numbers. Only single-byte characters are considered to be
alphabetic or numeric.
MATCHFIELD Returns a substring that matches a pattern or literal. Only singlebyte characters are considered to be alphabetic or numeric.
OCONV
Converts string or numeric data from internal format to display
format based on conversion codes.
REMOVE
Searches a dynamic array for system delimiters, then assigns the
delimiter and following array element to a variable. Recognizes
col.pos as a character position.
SEQ
Converts a single character to its ASCII code value.
UniBasic Character Recognition Functions (continued)
5-16 UniData International
Function
Comment
SEQS
Converts the first character in each element of a dynamic array to
its ASCII code value.
SUBSTRINGS
Extracts strings from elements within a dynamic array.
SWAP
Replaces all occurrences of one substring with a second substring.
UniBasic Character Recognition Functions (continued)
Note: Mask — multibyte characters may be masked for display purposes; however,
each doublebyte character uses two display characters. So, four doublebyte characters
displayed in the mask “###-###” prints as “XX -XX ” (two characters, space,
hyphen, two characters, and a space).
Singlebyte Functions
The functions listed here may not work properly when used with a multibyte
character set.
Function
Comment
ALPHA
Because UniBasic does not recognize multibyte characters as
alphabetic, returns 0 instead of converting them.
DOWNCASE
Converts only singlebyte characters to lower case.
FMT
Formats an expression for display. The length parameter defines
the number of display characters. The fill character must be
single-byte, and the justification option does not work for
multibyte languages. See the note on mask following this table.
NUM
Determines if an expression is numeric. Returns 0 for multibyte
characters.
NUMS
Determines, for each element of an array, if that element is
numeric. Returns 0 if the dynamic array element contains
multibyte characters.
Single-Byte Functions
5-17
Function
Comment
PROMPT
Sets the prompt displayed by the INPUT command to a specified
single-byte character. You cannot prompt with a multibyte
character.
SOUNDEX
Converts an expression into a phonetic code. May return
unpredictable results with multibyte characters.
UPCASE
Converts only single-byte characters to upper case.
Single-Byte Functions (continued)
Note: Mask — multibyte characters may be masked for display purposes; however,
each double-byte character uses two display characters. So, four doublebyte
characters displayed in the mask “###-###” prints as “XX -XX ” (two characters,
space, hyphen, two charactetrs, and a space).
Multibyte Functions
The following UniBasic functions are designed for use with multibyte
character sets.
Function
Description
BYTELEN
Returns the number of bytes in a string.
CHARLEN
Returns the number of characters in a string.
DISPLAYWIDTH
Returns the number of bytes required to display a string
expression.
ISMB
Returns a 0 for single-byte language setting, 1 for
multibyte language setting.
LEN
Returns the number of bytes in a string.
MBLEN
Returns the number of bytes required to display a
character.
UniBasic Functions for Multibyte Languages
Note: The examples used here are graphical representations of multibyte character
strings.
5-18 UniData International
BYTELEN
Syntax
BYTELEN (string)
Description
This UniBasic function returns the number of bytes required to store a
character. From one to four bytes may be required.
Example
The following representation of a string indicates below each “character” the
number of bytes required to store that character. The string contains 8 bytes,
therefore, BYTELEN would return 8 for this string.
Number
of bytes
2
3
1
2
5-19
CHARLEN
Syntax
CHARLEN (string)
Description
This UniBasic CHARLEN function returns the number of characters in a
character string. A multibyte character may require from one to four bytes to
encode.
Example
The following is a representation of a string of four multibyte characters.
CHARLEN would return 4 for this string.
Number
of bytes
5-20 UniData International
2
3
1
2
DISPLAYWIDTH
Syntax
DISPLAYWIDTH (string)
Description
This UniBasic function returns the number of bytes needed to display a string
expression. For instance, the display width of English characters is one. In
languages that use multibyte characters, the display width of a character can
be 1, 2, 3 or 4 bytes, depending on the language and the character.
Example
The following representation of a string indicates below each “character” the
number of bytes required to display that character. The string contains 8
bytes, therefore, DISPLAYWIDTH would return 8 for this string.
Number
of bytes
2
3
1
2
5-21
ISMB
Syntax
ISMB()
Description
This UniBasic function returns a code indicating whether the currently
installed language is made up of a single-byte or multibyte character set.
The function returns 0 to indicate a single-byte character set, or 1 for a
multibyte character set. For example, this function executed in a UniData
session for which the language is English returns 0; executed in a UniData
session for which the language is Japanese, the function returns 1.
5-22 UniData International
LEN
Syntax
LEN(str.expr)
Description
The UniBasic LEN function returns the length of character expression str.expr.
LEN supports multibyte languages.
With null value handling on, the null value has a length of one byte.
Examples
In the following example, the program segment displays 14, the length of the
string NAME:
NAME = "Arthur Fiedler"
PRINT LEN(NAME)
The following representation of a string indicates below each “character” the
number of bytes required to store that character. The string contains 8 bytes,
therefore LEN would return 8 for this string.
Number
of bytes
2
3
1
2
5-23
MBLEN
Syntax
MBLEN (string expression)
Description
This UniBasic function returns the number of bytes in the first character of a
string.
Example
The following representation of a string indicates below each “character” the
number of bytes required to display that character. MBLEN returns 2 for this
string, indicating that the first character is made up of 2 bytes.
Number
of bytes
5-24 UniData International
2
3
1
2
Appendix
Appendix A: UniData and
UNIX Locale
An important element in UniData International is the systemlevel locale. UniData has a file called LANGGRP in the
udthome/sys on UniData for UNIX or udthome\sys on UniData
for Windows Platforms, which defines the locale LANG setting.
When you start the configuration for a language, UniData looks
to the LANG setting. If the setting is incorrect for the language
you want to use, the configuration will not work.
A
UniData can run without locale, but it is not fully operational. For example,
uppercase and lowercase searches and sorting will not function. To use
UniData without locale, you must edit the LANGGRP file so that locale name
(in lower case in the example) for the language you will use is blank.
# UniData language group file
BEGIN
255/192/129
ENGLISH
ENGLISH
ENGLISH
# Language group 1
C
en_US
en_US.UTF-8
# US English
# US English
# US English
END
BEGIN
159/130/129
ENGLISH_G2
ENGLISH_G2
ENGLISH_G2
JAPANESE
FRENCH
# Language group 2
C
en_US
en_US.UTF-8
ja
fr
# Group 2 English
# Group 2 English
# US English
# EUC Japanese
# French
END
BEGIN
20/31/30
# Language group 3
ENGLISH_G3
ENGLISH_G3
ENGLISH_G3
GB18030
C
en_US
en_US.UTF-8
C
#
#
#
#
Group 3 English
Group 3 English
US English
Simplified Chinese
GB18030
en_US
# Simplified Chinese
GB18030
GB18030
END
A-2
UniData International
There are no industry standards for naming locale. To find out available
names, use the locale command with the -a argument to display a list of locale
settings available on your machine. The following example was generated on
an AIX machine:
% locale -a
en_US.ISO8859-1
En_US.IBM-850
de_CH.ISO8859-1
De_CH.IBM-850
de_DE.ISO8859-1
De_DE.IBM-850
en_GB.ISO8859-1
En_GB.IBM-850
es_ES.ISO8859-1
Es_ES.IBM-850
fr_BE.ISO8859-1
Fr_BE.IBM-850
fr_CA.ISO8859-1
Fr_CA.IBM-850
fr_CH.ISO8859-1
Fr_CH.IBM-850
fr_FR.ISO8859-1
Fr_FR.IBM-850
ja_JP.IBM-eucJP
en_JP.ISO8859-1
Ja_JP.IBM-932
En_JP.IBM-850
zh_TW.o
zh_TW.IBM-eucTW
%
On most systems, the locale command without an argument displays a list
similar to the following:
% locale
LANG=C
LC_CTYPE="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=
Tip: The “C” category stands for English and is the default value on most machines,
according to the International Standards Organization’s “C” specifications.
A-3
The next example shows the LANG set for French:
% locale
LANG=fr_FR
LC_CTYPE="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=
Note: You do not need to use the entire locale name. For instance, in the locale -a list,
French is listed as fr_FR.iso88519. You can just set LANG to fr_FR.
Locale Environment Variables
The following table describes each variable found in locale. The LANG
setting overrides these variables, so you do not need to set them individually.
If you want to override the individual settings, you must do this within
UniData.
Variable
Description
LANG
Controls the character set and language.
LC_TYPE
Controls character handling functions.
LC_COLLATE
Specifies the sorting order.
LC_MONETARY
Specifies monetary formats.
LC_NUMERIC
Specifies the decimal delimiter and the thousand
delimiter.
LC_TIME
Specifies date and time formats, including names of days,
months, and seasons.
LC_MESSAGES
Contains translated messages.
LC_ALL
Overrides all the other LC directory settings.
Locale Variables
A-4
UniData International