+ All Categories
Home > Documents > UniData - Rocket Software · : English is included in all language groups, because it is commonly...

UniData - Rocket Software · : English is included in all language groups, because it is commonly...

Date post: 06-May-2020
Category:
Upload: others
View: 6 times
Download: 0 times
Share this document with a friend
95
C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\INTERNATIONAL\UDTITITL.fm March 8, 2010 1:25 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta UniData UniData International UDT-720-UDTI-1
Transcript
Page 1: UniData - Rocket Software · : 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

C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\INTERNATIONAL\UDTITITL.fmMarch 8, 2010 1:25 pm

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta

UniData

UniData International

UDT-720-UDTI-1

Page 2: UniData - Rocket Software · : 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

ii UniData Internatio

C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\INTERNATIONAL\UDTITITL.fmMarch 8, 2010 1:25 pm

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta

Notices

EditionPublication date: July 2008Book number: UDT-720-UDTI-1Product version: UniData 7.2

Copyright© Rocket Software, Inc. 1988-2008. All Rights Reserved.

TrademarksThe following trademarks appear in this publication:

Trademark Trademark Owner

Rocket Software™ Rocket Software, Inc.

Dynamic Connect® Rocket Software, Inc.

RedBack® Rocket Software, Inc.

SystemBuilder™ Rocket Software, Inc.

UniData® Rocket Software, Inc.

UniVerse™ Rocket Software, Inc.

U2™ Rocket Software, Inc.

U2.NET™ Rocket Software, Inc.

U2 Web Development Environment™ Rocket Software, Inc.

wIntegrate® Rocket Software, Inc.

Microsoft® .NET Microsoft Corporation

Microsoft® Office Excel®, Outlook®, Word Microsoft Corporation

Windows® Microsoft Corporation

Windows® 7 Microsoft Corporation

Windows Vista® Microsoft Corporation

Java™ and all Java-based trademarks and logos Sun Microsystems, Inc.

UNIX® X/Open Company Limited

nal

Page 3: UniData - Rocket Software · : 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

The above trademarks are property of the specified companies in the United States, other countries, or both. All other products or services mentioned in this document may be covered by the trademarks, service marks, or product names as designated by the companies who own or market them.

License agreementThis software and the associated documentation are proprietary and confidential to Rocket Software, Inc., are furnished under license, and may be used and copied only in accordance with the terms of such license and with the inclusion of the copyright notice. This software and any copies thereof may not be provided or otherwise made available to any other person. No title to or ownership of the software and associated documentation is hereby transferred. Any unauthorized use or reproduction of this software or documentation may be subject to civil or criminal liability. The information in the software and documentation is subject to change and should not be construed as a commitment by Rocket Software, Inc.

Restricted rights notice for license to the U.S. Government: Use, reproduction, or disclosure is subject to restrictions as stated in the “Rights in Technical Data-General” clause (alternate III), in FAR section 52.222-14. All title and ownership in this computer software remain with Rocket Software, Inc.

NoteThis 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.

Please be aware: Any images or indications reflecting ownership or branding of the product(s) documented herein may or may not reflect the current legal ownership of the intellectual property rights associated with such product(s). All right and title to the product(s) documented herein belong solely to Rocket Software, Inc. and its subsidiaries, notwithstanding any notices (including screen captures) or any other indications to the contrary.

Contact informationRocket Software275 Grove Street Suite 3-410Newton, MA 02466-2272 USA Tel: (617) 614-4321 Fax: (617) 630-7100Web Site: www.rocketsoftware.com

UniData International iii

Page 4: UniData - Rocket Software · : 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

Table of Contents

:\ProgMarch

Table of Contents

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta

Chapter 1 Introduction to UniData InternationalWhat is Internationalization? . . . . . . . . . . . . . . . 1-3What UniData International Provides . . . . . . . . . . . . . 1-4Language Groups . . . . . . . . . . . . . . . . . . . 1-5

Language Group ID . . . . . . . . . . . . . . . . . 1-6UniBasic Programming. . . . . . . . . . . . . . . . 1-6Date, Numeric, and Currency Formats . . . . . . . . . . . 1-7

Language Message Files . . . . . . . . . . . . . . . . . 1-8Language Message Default Record . . . . . . . . . . . . 1-8Customization . . . . . . . . . . . . . . . . . . 1-9

General Rules . . . . . . . . . . . . . . . . . . . . 1-10Definitions, Acronyms, Abbreviations . . . . . . . . . . . . 1-11

Chapter 2 Language ConfigurationStarting UniData in a Language Group . . . . . . . . . . . . 2-3

Chapter 3 Customizing UniData InternationalEditing the DEFAULTS Record . . . . . . . . . . . . . . 3-3Adding a Language to a Language Group . . . . . . . . . . . 3-5Adding a Language Group . . . . . . . . . . . . . . . . 3-11Starting UniData SQL in a Local Language . . . . . . . . . . . 3-12UDT.OPTIONS 53

U_PMOD_THROWAWAY . . . . . . . . . . . . . . 3-13Using Menus to Translate VOC Keywords . . . . . . . . . . . 3-14Sorting Order . . . . . . . . . . . . . . . . . . . . 3-16

Adding a Record to the COLLATIONS File . . . . . . . . . 3-17Pointing to a New Record in the Language Message File . . . . . 3-19

Chapter 4 Commands ReferenceDATE.FORMAT . . . . . . . . . . . . . . . . . . . 4-3LIST.LANGGRP . . . . . . . . . . . . . . . . . . . 4-6

ram Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\INTERNATIONAL\UDTITOC.fm (bookTOC.template)8 2010 1:25 pm

Page 5: UniData - Rocket Software · : 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

SET.LANG . . . . . . . . . . . . . . . . . . . . . 4-7SET.MONEY . . . . . . . . . . . . . . . . . . . . 4-9SET.DEC . . . . . . . . . . . . . . . . . . . . . . 4-12SET.THOUS. . . . . . . . . . . . . . . . . . . . . 4-14UPDATE.LANG.DEFAULTS . . . . . . . . . . . . . . . 4-16convmark . . . . . . . . . . . . . . . . . . . . . . 4-19

Chapter 5 Multibyte Language ReferenceLimitations and Exclusions . . . . . . . . . . . . . . . . 5-3Storing Characters . . . . . . . . . . . . . . . . . . . 5-4Displaying Characters . . . . . . . . . . . . . . . . . . 5-5Multibyte Configuration File. . . . . . . . . . . . . . . . 5-6Adding a Multibyte Language to UniData . . . . . . . . . . . 5-7UniBasic Multibyte Support . . . . . . . . . . . . . . . . 5-15

Modified Functions and Commands . . . . . . . . . . . . 5-15Singlebyte Functions . . . . . . . . . . . . . . . . 5-17Multibyte Functions . . . . . . . . . . . . . . . . . 5-18

BYTELEN . . . . . . . . . . . . . . . . . . . . . 5-19CHARLEN . . . . . . . . . . . . . . . . . . . . . 5-20DISPLAYWIDTH . . . . . . . . . . . . . . . . . . . 5-21ISMB . . . . . . . . . . . . . . . . . . . . . . . 5-22LEN . . . . . . . . . . . . . . . . . . . . . . . 5-23MBLEN . . . . . . . . . . . . . . . . . . . . . . 5-24

Appendix A UniData and UNIX Locale

Table of Contents v

Page 6: UniData - Rocket Software · : 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

1Chapter

Introduction to UniData International

What is Internationalization? . . . . . . . . . . . . . . . 1-3What UniData International Provides . . . . . . . . . . . . 1-4Language Groups . . . . . . . . . . . . . . . . . . 1-5 Language Group ID . . . . . . . . . . . . . . . . 1-6 UniBasic Programming . . . . . . . . . . . . . . . 1-6 Date, Numeric, and Currency Formats . . . . . . . . . . 1-7Language Message Files . . . . . . . . . . . . . . . . 1-8 Language Message Default Record . . . . . . . . . . . 1-8 Customization . . . . . . . . . . . . . . . . . . 1-9General Rules . . . . . . . . . . . . . . . . . . . . 1-10Definitions, Acronyms, Abbreviations . . . . . . . . . . . . 1-11

Page 7: UniData - Rocket Software · : 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

This manual describes what UniData provides for internationalization and local-ization. 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, “Language Configuration” — explains how to use the language configuration script to run UniData in your language.Chapter 3, “Customizing UniData International” — describes the utilities and commands available to customize UniData for your environment.Chapter 4, “Commands Reference” — explains ECL commands relevant to UniData International.Chapter 5, “Multibyte Language Reference” — describes tools designed for languages using multibyte character sets.

1-2

Page 8: UniData - Rocket Software · : 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

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. International-ization may also customize the UniData display of time, date, and monetary signs.

1-3 UniData International

Page 9: UniData - Rocket Software · : 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

What UniData International ProvidesUniData 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 — stores data in the specified language, displays the data in a proper format, and accepts input of language characters.Localized language message files — stores and displays messages in the local language.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 internation-alization, 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

Page 10: UniData - Rocket Software · : 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

Language GroupsLanguage 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.

UniData Language Group Delimiters

Delimiter Symbol @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

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

Page 11: UniData - Rocket Software · : 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

Language Group IDSeven 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 its record mark, escape sequence mark, and a mark reserved for future devel-opment. 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 Language Groups

Group # udtlang NameLanguage Group ID

Group 1 English (US, UK) 255/192/129

Group 2 Some Multi-byte languagesJapanese (EUC)French (ISO8859-1)English_G2 (English)

159/130/129

UniBasic ProgrammingPart 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

1-6

Page 12: UniData - Rocket Software · : 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

Date, Numeric, and Currency FormatsDifferent 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, “Customizing UniData International.” UniData uses the following defaults.

Default Convention Formats

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

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-7 UniData International

Page 13: UniData - Rocket Software · : 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

Language Message FilesUniData 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 RecordWithin 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, “Customizing UniData International.”

.},}$}1 DIMANCHE}LUNDI}MARDI}MERCREDI}JEUDI}VENDREDI}SAMEDIJAN}FEV}MAR}AVR}MAI}JUN}JLT}AOU}SEP}OCT}NOV}DECPRINTEMPS}ETE}AUTOMNE}HIVERY}N}QEND~~..“/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-8

Page 14: UniData - Rocket Software · : 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

CustomizationYou 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, “Customizing UniData International,” to learn how to customize default records, keywords, and commands.

1-9 UniData International

Page 15: UniData - Rocket Software · : 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

General RulesThe following is a list of provisions to keep in mind when using 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.

1-10

Page 16: UniData - Rocket Software · : 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

Definitions, Acronyms, AbbreviationsThe 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-11 UniData International

Page 17: UniData - Rocket Software · : 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

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.

Term Definition

Definitions (continued)

1-12

Page 18: UniData - Rocket Software · : 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

2Chapter

Language Configuration

Starting UniData in a Language Group . . . . . . . . . . . . 2-3

Page 19: UniData - Rocket Software · : 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

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, “Introduction to UniData International.”

Before beginning the UniData language configuration, you:

Must have root privileges on UniData for UNIX for Administrator privi-leges on UniData for Windows PlatformsShould have some knowledge of locale concepts

2-2

Page 20: UniData - Rocket Software · : 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

Starting UniData in a Language GroupSince 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 UsersUsers 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.

# listuserLicensed/Effective # of Users Udt Sql Total

32 / 32 1 0 1

UDTNO USRNBR UID USRNAME USRTYPE TTY TIME DATE

2. Stop UniDataYou must stop UniData before you can execute the language configuration script. From the udtbin directory, execute ./stopud.

# ./stopudUsing UDTBIN=/disk1/ud61/bin

SM stopped successfully.CLEANUPD stopped successfully.SBCS stopped successfully.SMM stopped successfully.

Unidata R6.1 has been shut down.

#

2-3 UniData International

Page 21: UniData - Rocket Software · : 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

3. Verify LANG SettingThe language environment variable, LANG, must be set to the same lan-guage 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 Eng-lish and is the default value on most platforms, according to the International Standards Organization’s “C” specifications. Check your cur-rent environment for the LANG setting.

4. Setting the LANG Environment VariableIf 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

Page 22: UniData - Rocket Software · : 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

To set the 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 example appears:

2-5 UniData International

Page 23: UniData - Rocket Software · : 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

Click the Advanced tab, then click Environment Variables. The Environ-ment Variables dialog box appears, as shown in the following example:

In the Variable box, enter “LANG”. In the value box, enter the language group.

5. Execute the udtlangconfig ScriptThe 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.

2-6

Page 24: UniData - Rocket Software · : 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

Note: Language group numbers correspond to the record mark value (@RM), print at value (@PRINT_AT), and the null value. If you are currently running UniData 3.3.2i, you need to run udtlangconfig to change the print at value from the previous 128 to the new 130 ASCII 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/ud71/bin WARNING: 'stopud -f' will stop the Unidata System with force.This may not guarantee the consistency of the database files.

2-7 UniData International

Page 25: UniData - Rocket Software · : 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

Would you like to continue?(y/n) [n] ySM stopped successfully.CLEANUPD stopped successfully.SMM stopped successfully.SBCS stopped successfully. Unidata R6.0 has been shut down. Please select the appropriate language from the list below: Language Locale ------------------------------ ENGLISH C ENGLISH_UK english ENGLISH_G2 C JAPANESE japanese.euc FRENCH french ------------------------------ Please enter language from above list [FRENCH]: FRENCH

Input complete, UniData processing...Using UDTBIN=/disk1/ud72/bin All output and error logs have been savedto /disk1/ud72/bin/saved_logs directory. SMM is started.SBCS is started.CLEANUPD is started.SM is started.

UniData R7.2 has been started. You now have completed the configuration process.This is the end of the configuration process.

2-8

Page 26: UniData - Rocket Software · : 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

6. Convert Additional DataYou may need to convert data in other accounts if you have been using a pre-vious 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 and other 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.

convmark Parameters

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:• 159/130/129 French, Japanese, and English• 255/192/129 English

path 1 [path 2. . .] Specifies the full path to the files to convert.

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 conv-mark 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 conver-sion, but does not convert them.

2-9 UniData International

Page 27: UniData - Rocket Software · : 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

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 the its record mark, escape sequence mark value, and a reserved value, separated by a slash (for example, 255/192/129 for Language Group 1, and 159/130/129 for Language Group 2).

UniData Language Groups

Group # udtlang NameLanguage Group ID

Group 1 English (US, UK) 255/192/129

Group 2 Japanese (EUC)French (ISO8859-1)English_G2 (English)

159/130/129

2-10

Page 28: UniData - Rocket Software · : 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

Note: Language group numbers correspond to the record mark value (@RM), print at value (@PRINT_AT), and the null value. If you are currently running UniData 3.3.2i, you need to execute udtlangconfig to change the previous values to the UniData 6.0 values.

When you use convmark without an argument, UniData returns a usage statement, as shown in the following example:

% convmarkUsage: 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 file127 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 cur-rent directory:

% convmark 159/130/129..../include/udtconfig.old: not a UniData file./include/udtconfig.bak: not a UniData file127 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 UniData International

Page 29: UniData - Rocket Software · : 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

1. Recompile UniBasic ProgramsYou 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 UniBa-sic Applications.

2. Enter a UniData SessionChange directories to the demo account and start a UniData session with the udt command:

% udt

The following screen appears:UniData Release 6.1 Build: (3095) (c) Copyright IBM Corporation, 2005. All rights reserved. Current UniData home is /liz1/ud61/. Current working directory is /home/claireg.:

UniData is now running in the language group and the language you specified.

2-12

Page 30: UniData - Rocket Software · : 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

3Chapter

Customizing UniData International

Editing the DEFAULTS Record . . . . . . . . . . . . . . 3-3Adding a Language to a Language Group . . . . . . . . . . . 3-5Adding a Language Group . . . . . . . . . . . . . . . . 3-11Starting UniData SQL in a Local Language . . . . . . . . . . 3-12UDT.OPTIONS 53

U_PMOD_THROWAWAY . . . . . . . . . . . . . . 3-13Using Menus to Translate VOC Keywords. . . . . . . . . . . 3-14Sorting Order . . . . . . . . . . . . . . . . . . . . 3-16 Adding a Record to the COLLATIONS File . . . . . . . . . 3-17 Pointing to a New Record in the Language Message File . . . . . 3-19

Page 31: UniData - Rocket Software · : 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

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.

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 keywordsUsing Menus to Translate VOC Keywords Creating a custom COLLATIONS file

3-2

Page 32: UniData - Rocket Software · : 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

Editing the DEFAULTS RecordYou 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}SAMEDIJAN}FEV}MAR}AVR}MAI}JUN}JLT}AOU}SEP}OCT}NOV}DECPRINTEMPS}ETE}AUTOMNE}HIVERY}N}QEND...“/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}SaturdayJanuary}February}March}April}May}June}July}August}September}Octo ber}November}DecemberWinter}Spring}Summer}AutumnY}N}QEND...“/tmp/__ED17400” 7 lines, 190 characters

3-3 UniData International

Page 33: UniData - Rocket Software · : 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

Each value within a multivalued attribute is separated by a brace. The following table describes each attribute in the MSG DEFAULTS record.

DEFAULTS Record Attribute Descriptions

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”.

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.FORMATSET.MONEYSET.DECSET.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, “Commands Reference.”

3-4

Page 34: UniData - Rocket Software · : 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

Adding a Language to a Language GroupYou 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 supportTranslated message files

Note: If you are adding a multibyte character set, refer to Chapter 5, “Multibyte Language Reference” for step-by-step instructions.

1. Check for UsersUsers 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.

# listuserLicensed/Effective # of Users Udt Sql Total

32 / 32 0 0 0

UDTNO USRNBR UID USRNAME USRTYPE TTY TIME DATE

2. Stop UniDataExecute stopud from the udtbin directory:

# stopud

3-5 UniData International

Page 35: UniData - Rocket Software · : 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

3. Edit the LANGGRP FileUse 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 C # US English ENGLISH_UK english # UK English END BEGIN 159/130/129 # Language group 2 ENGLISH_G2 C # Group 2 English JAPANESE japanese.euc # EUC Japanese FRENCH french # French SPANISH es_ES # Spanish

END

4. Set Up Message FileUniData cannot operate in the new language unless a message file exists. From the system-level prompt, copy the English message file or other mes-sage 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 the UniData language name concatenated to .MSG. See the LIST.LANGGRP command in Chapter 4, “Commands Reference,” for more information about udtlang names. The following example shows how the English_G2.MSG file is cop-ied and named SPANISH.MSG:

% cp ENGLISH_G2.MSG SPANISH.MSG

3-6

Page 36: UniData - Rocket Software · : 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

5. Set the UDT_LANG Environment VariableIf your operating system does not have a locale setting for the new language, set the environment variable UDT_LANG to the new language. The follow-ing 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=xtermSHELL=/bin/csh...LANG=CUDTHOME=/usr/ud71UDTBIN=/usr/ud71/binUDT_LANG=SPANISH

3-7 UniData International

Page 37: UniData - Rocket Software · : 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

The next example illustrates how to set the UDT_LANG environment vari-able on UniData for Windows Platforms. From the Start menu, click Control Panel, then double-click System. A window similar to the follow-ing appears:

3-8

Page 38: UniData - Rocket Software · : 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

Click the Advanced tab, then click Environment Variables. A dialog box similar to the following example appears:

In the Variable box, enter “UDT_LANG.” In the value box, enter the lan-guage, as shown in the preceding example.

3-9 UniData International

Page 39: UniData - Rocket Software · : 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

6. Start UniDataFrom the udtbin directory, start UniData:

# startudUsing UDTBIN=/disk1/ud72/bin

All output and error logs have been savedto /disk1/ud72/bin/saved_logs directory.

SMM is started.SBCS is started.CLEANUPD is started.SM is started.

UniData R7.2 has been started.:

7. Start a UniData SessionChange 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

Page 40: UniData - Rocket Software · : 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

Adding a Language GroupAdding a new language group requires the following components:

locale supportTranslated message filesEdited UniData LANGGRP fileEdited UniData udtconfig fileConverted data

3-11 UniData International

Page 41: UniData - Rocket Software · : 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

Starting UniData SQL in a Local LanguageEnter SQL to start UniData SQL regardless of your language group setting:

:SET.LANG FRENCHLangage 'FRENCH' assigné !:SQLsql>

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. :SQLa. sql> SELECT * FROM COURSES;a. Pas de privilège sur le fichier COURSES!

This message in English is: No privilege on file COURSES.

3-12

Page 42: UniData - Rocket Software · : 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

UDT.OPTIONS 53 U_PMOD_THROWAWAYUse 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:

Throwaway Keywords with UDT.OPTIONS 53

Language Text

English LIST VOC WITH F1 = “N” OR WITH F1 = “M”

French LISTEZ VOC AVEC F1 = “N” OU AVEC F1 = “M”

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-13 UniData International

Page 43: UniData - Rocket Software · : 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

Using Menus to Translate VOC KeywordsYou 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 18:17:43 Feb 09 1998

1= Enter/Modify a MENU 2= Enter/Modify a formatted MENU 3= Display a summary of all MENUs on a MENU file 4= Display the contents of a MENU 5= Enter/Modify a VOC MENU selector 6= Enter/Modify a VOC stored sentence item 7= Display all MENU selector item on the VOC file 8= Display all stored sentence items on the VOC file 9= Display the dictionary of a file10= Print a summary of all MENUs on a MENU file11= Print the contents of a MENU12= Print the dictionary of a file13= Enter/Modify a VOC stored paragraph item

2. 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-14

Page 44: UniData - Rocket Software · : 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

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=1name=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-15 UniData International

Page 45: UniData - Rocket Software · : 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

Sorting OrderThe 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.

COLLATIONSTESTING

CUSTOM.SORTattr 1: C 1attr 2:* This is a collation table. attr 3: 00

ENGLISH.MSG

DEFAULTS

attr 1: , . $ 0

attr 2:

attr 3: Sunday Monday Tuesday ...

attr 4: January February March April ...

attr 5: Winter Spring Summer Autumn

attr 7: CUSTOM.SORT

.

.

.

attr 258:

0

attr 6: Y N Q

Note: The default COLLATIONS file contains record 0, which is reserved for internal UniData use. You should not modify this record.

3-16

Page 46: UniData - Rocket Software · : 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

Adding a Record to the COLLATIONS FileYou must log in 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 COLLA-TIONS 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 2004 1COLLATIONS TESTING02 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.SORT1 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.

Default COLLATIONS Order

Character HEX

A 41

B 42

C 43

D 44

E 45

F 46

3-17 UniData International

Page 47: UniData - Rocket Software · : 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

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.

COLLATIONS TESTING Order

Character HEX

F 46

E 45

D 44

C 43

B 42

A 41

The next example shows the same part of the new CUSTOM.SORT record as in the preceding tables.

Current UniData home is /disk1/ud71/.Current working directory is /disk1/ud71/sys.:AE COLLATIONS CUSTOM.SORTTop of "CUSTOM.SORT" in "COLLATIONS", 258 lines, 801 characters.*--: 66066: 3F067: 40068: 46069: 45070: 44071: 43072: 42073: 41074: 47075: 48076: 49

3-18

Page 48: UniData - Rocket Software · : 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

Pointing to a New Record in the Language Message FileTo 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.MSGRecord ids > DEFAULTSTop of "DEFAULTS" in "ENGLISH.MSG", 6 lines, 185 characters.001: , . $ 0002: 003: Sunday Monday Tuesday Wednesday Thursday Friday Saturday004: January February March April May June July August September October

November December005: Winter Spring Summer Autumn006: Y N QBottom.*--: I007= CUSTOM.SORT*--: FIFiled "DEFAULTS" in file "ENGLISH.MSG".

3-19 UniData International

Page 49: UniData - Rocket Software · : 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 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 2004 1TAPES..... Tape Name........... V8481 'Round MidnightV6670 2001V1254 Flash GordonV8181 Catch 22V996 Citizen KaneV2001 Blue VelvetV7456 A Clockwork OrangeV4951 American GraffitiV110 Girl FridayV1249 Gone With The WindV9431 HelpV4637 If...V5004 Journey AbroadB2297 Love StoryV4499 PsychoV1231 ScaramoucheV1077 SleuthB914 TammyV9961 The StalkerV5151 To Kill AEnter <New line> to continue...

3-20

Page 50: UniData - Rocket Software · : 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

4Chapter

Commands Reference

DATE.FORMAT . . . . . . . . . . . . . . . . . . . 4-3LIST.LANGGRP. . . . . . . . . . . . . . . . . . . 4-6SET.LANG . . . . . . . . . . . . . . . . . . . . 4-7SET.MONEY . . . . . . . . . . . . . . . . . . . . 4-9SET.DEC . . . . . . . . . . . . . . . . . . . . . 4-12SET.THOUS . . . . . . . . . . . . . . . . . . . . 4-14UPDATE.LANG.DEFAULTS . . . . . . . . . . . . . . . 4-16convmark . . . . . . . . . . . . . . . . . . . . . 4-19

Page 51: UniData - Rocket Software · : 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

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.FORMATLIST.LANGGRPSET.LANGSET.MONEYSET.DECSET.THOUSconvmark — 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

Page 52: UniData - Rocket Software · : 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

DATE.FORMAT

SyntaxDATE.FORMAT {0 | 1 | AMERICAN | EUROPEAN}

DescriptionThe 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

Page 53: UniData - Rocket Software · : 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

ExampleThe 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/9438 records listed

4-4

Page 54: UniData - Rocket Software · : 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

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 1Cust...... 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/9438 records listed

4-5 UniData International

Page 55: UniData - Rocket Software · : 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

LIST.LANGGRP

SyntaxLIST.LANGGRP

This command displays the current language group ID.

ExamplesThe following example shows the setting for language group 2:

:LIST.LANGGRPCurrent language group ID: 159/130/129

The next example shows the setting for language group 1:

:LIST.LANGGRPCurrent 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. If you are upgrading from a release earlier than 3.3.2i on UniData for UNIX, you need to execute udtlang-config to change the print at value from 128 to 130 ASCII value.

UniData Language Groups

Group # udtland NameLanguage Group ID

Group 1 English (US, UK) 255/192/129

Group 2 Japanese (EUC)French (ISO8859-1)English_G2 (English)

159/130/129

4-6

Page 56: UniData - Rocket Software · : 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

SET.LANG

SyntaxSET.LANG udt.lang | [CURRENT | AVAILABLE]

DescriptionThe 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 to choose from, or type CURRENT to display the current language setting. If you enter SET.LANG without parameters, UniData displays a usage statement.

ParametersThe following table describes the SET.LANG parameters.

SET.LANG Parameters

Option Description

udtlang Specifies the UniData operating language:ENGLISH_G2FRENCHJAPANESE

CURRENT Displays the current language setting.

AVAILABLE Displays the available language names.

4-7 UniData International

Page 57: UniData - Rocket Software · : 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

ExampleIn 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.LANGUsage: SET.LANG <udtlang>|CURRENT|AVAILABLE

:SET.LANG AVAILABLEENGLISH_G2JAPANESEFRENCH

:SET.LANG FRENCHLangage '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.

DEFAULTS Formats

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

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

Page 58: UniData - Rocket Software · : 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

SET.MONEY

SyntaxSET.MONEY sign [POST | PRE]

DescriptionThe 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.

ExamplesThe following example shows the result of the SET.MONEY command used without an argument:

:SET.MONEYUsage: SET.MONEY <money sign>

4-9 UniData International

Page 59: UniData - Rocket Software · : 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 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 2004 1TAPES..... Tape Cost Tape Name........... B914 $9.99 TammyV110 $22.50 Girl FridayV1231 $23.00 ScaramoucheV5004 $23.25 Journey AbroadV1254 $23.50 Flash Gordon...V4637 $40.00 If...V2001 $44.00 Blue VelvetV4951 $45.00 American GraffitiV6670 $45.00 2001V8181 $45.00 Catch 22V996 $45.00 Citizen KaneV8481 $65.00 ‘Round MidnightV7456 $77.00 A Clockwork OrangeV1249 $78.00 Gone With The Wind21 records listed

4-10

Page 60: UniData - Rocket Software · : 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 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 2004 1TAPES..... Tape Cost Tape Name........... B914 9,99 F TammyV110 22,50 F Girl FridayV1231 23,00 F ScaramoucheV5004 23,25 F Journey AbroadV1254 23,50 F Flash Gordon...V4637 40,00 F If...V2001 44,00 F Blue VelvetV4951 45,00 F American GraffitiV6670 45,00 F 2001V8181 45,00 F Catch 22V996 45,00 F Citizen KaneV8481 65,00 F ‘Round MidnightV7456 77,00 F A Clockwork OrangeV1249 78,00 F Gone With The Wind21 articles listés

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

Page 61: UniData - Rocket Software · : 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

SET.DEC

SyntaxSET.DEC character

DescriptionThe 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.

ExampleIn the following example, the SET.DEC command changes the decimal character to a comma (,):

:SET.DEC ,

4-12

Page 62: UniData - Rocket Software · : 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

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 2004 1TAPES..... Tape Cost Tape Name........... B914 $9,99 TammyV110 $22,50 Girl FridayV1231 $23,00 ScaramoucheV5004 $23,25 Journey AbroadV1254 $23,50 Flash GordonV4341 $23,50 ZV4499 $23,50 Psycho...

4-13 UniData International

Page 63: UniData - Rocket Software · : 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

SET.THOUS

SyntaxSET.THOUS character

DescriptionThe 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.

ExamplesIn 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 2005 1STAFF..... Salary. 1 31.2008 98.0007 29.9002 25.8003 42.0004 32.5006 35.8009 19.9005 26.8009 records listed

4-14

Page 64: UniData - Rocket Software · : 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 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 2005 1STAFF..... Salary. 1 31,2008 98,0007 29,9002 25,8003 42,0004 32,5006 35,8009 19,9005 26,8009 records listed

4-15 UniData International

Page 65: UniData - Rocket Software · : 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

UPDATE.LANG.DEFAULTS

SyntaxUPDATE.LANG.DEFAULTS

DescriptionThis 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 0 @ID=DEFAULTS 1 ALTERNATIVE_MESSAGE_FILE= 2 COLLATION=3 ==>THOU_DEC_MON_DATEFORMAT4 ==>DAYS_OF_WEEK5 ==>MONTHS6 ==>SEASONS7 ==>PROMPTS FROM 3 to 7 ARE MULTI VALUED FIELDS SCREENS. Enter 'DELETE' 'UNCHANGE' 'QUIT' or NUMBER to changeChange=

4-16

Page 66: UniData - Rocket Software · : 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

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.”

Attribute Description

@ID= Name of the message file. IBM does 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

4-17 UniData International

Page 67: UniData - Rocket Software · : 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

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 exam-ple, 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. 1No. PROMPTS 1 Y 2 N 3 Q 4Change which line=1Enter 'DELETE'/ 'INSERT' /Column number to change=1Y_N_Q=OChange which column= MSG.DEFAULTS RECORD ID==>Column No. 1No. 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, “Customizing UniData International.”

4-18

Page 68: UniData - Rocket Software · : 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

convmark

Syntaxconvmark [ -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, “Language Configu-ration,” in this manual.

ParametersThe following table describes the parameters for convmark.

convmark Parameters

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:• 159/130129 French, Japanese and English• 255/192/129 English

[(path 1) (path 2). . .]] Specifies the full path to the directory or files to convert.

4-19 UniData International

Page 69: UniData - Rocket Software · : 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

5Chapter

Multibyte Language Reference

Limitations and Exclusions . . . . . . . . . . . . . . . 5-3Storing Characters . . . . . . . . . . . . . . . . . . 5-4Displaying Characters . . . . . . . . . . . . . . . . . 5-5Multibyte Configuration File . . . . . . . . . . . . . . . 5-6Adding a Multibyte Language to UniData . . . . . . . . . . . 5-7UniBasic Multibyte Support . . . . . . . . . . . . . . . 5-15 Modified Functions and Commands . . . . . . . . . . . 5-15 Singlebyte Functions . . . . . . . . . . . . . . . . 5-17 Multibyte Functions . . . . . . . . . . . . . . . . 5-18BYTELEN. . . . . . . . . . . . . . . . . . . . . 5-19CHARLEN . . . . . . . . . . . . . . . . . . . . 5-20DISPLAYWIDTH . . . . . . . . . . . . . . . . . . 5-21ISMB . . . . . . . . . . . . . . . . . . . . . . 5-22LEN . . . . . . . . . . . . . . . . . . . . . . . 5-23MBLEN . . . . . . . . . . . . . . . . . . . . . 5-24

Page 70: UniData - Rocket Software · : 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

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

Page 71: UniData - Rocket Software · : 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

Limitations and ExclusionsUniData 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

Page 72: UniData - Rocket Software · : 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

Storing CharactersCharacters 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.

2 3 1 2Number of bytes

Characters

5-4 UniData International

Page 73: UniData - Rocket Software · : 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

Displaying CharactersFor 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

Page 74: UniData - Rocket Software · : 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

Multibyte Configuration FileUniData 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 single-byte encoding method.

5-6 UniData International

Page 75: UniData - Rocket Software · : 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

Adding a Multibyte Language to UniDataWarning: 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 in as root on UniData for UNIX or Administrator on UniData for Windows Platforms to perform this process.

1. Check for UsersAll users must be logged off the system so that you can stop all UniData pro-cesses. Use the listuser command for to find out if users are currently logged on.

# listuserLicensed/Effective # of Users Udt Sql Total

32 / 32 0 0 0

UDTNO USRNBR UID USRNAME USRTYPE TTY TIME DATE

2. Stop UniDataExecute stopud from the udtbin directory:

# stopud

5-7

Page 76: UniData - Rocket Software · : 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

3. Add an Entry to the MULTIBYTE.CONFIG FileUse 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 fol-low. See your host system documentation for the encoding detail.Syntax:

BEGIN # Begin entry for Languageudtlang # udtlang namebytes:display width:1st range,2nd range # encoding 1bytes:display width:1st range,2nd range # encoding 2END # End entry for Language

ParametersEach entry must follow the preceding syntax format. The following table describes each element.

MULTIBYTE.CONFIG File Parameters

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.

ExamplesThe following is an example of the MULTIBYTE.CONFIG file entry for the Japanese EUC encoding system. Blank lines are inserted for legibility.

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 # EUC code set 2. (half-katakana), 2 bytes, 1 display

5-8 UniData International

Page 77: UniData - Rocket Software · : 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

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 # udtlang name for GB 23122:2:161-254:161-254 # 2 bytes, 2 display widths. # first byte range: 161-254 # second byte ranges: 64-126, 161-254END # end of CHINESE.GB BEGIN # Fusheng encoding CHINESE.FS # udtlang name for Fusheng4:2:176-191:49-90:49-90:49-90 # 4 bytes, 2 display widths. # first byte range: 176-191 # second-4th byte ranges: 49-90END # end of CHINESE.FS

5-9

Page 78: UniData - Rocket Software · : 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

4. Add the Language to LANGGRPThe 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 C # US English ENGLISH_UK english # UK English END BEGIN 159/130/129

# Language group 2 ENGLISH_G2 C # Group 2 English JAPANESE japanese.euc # EUC Japanese FRENCH french # French CHINESE_GB # ChineseGB 2312 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,” Uni-Data 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

Page 79: UniData - Rocket Software · : 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

5. Set Up the Message FileUniData 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 dis-plays 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_LANGUse 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 follow-ing 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=xtermSHELL=/bin/csh...LANG=CUDTHOME=/usr/ud71UDTBIN=/usr/ud71/binUDT_LANG=CHINESE_GB%

5-11

Page 80: UniData - Rocket Software · : 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

The next example illustrates how to set the UDT_LANG environment vari-able on UniData for Windows Platforms. From the Start menu, click Control Panel, then double-click System. The following window appears:

5-12 UniData International

Page 81: UniData - Rocket Software · : 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

Click the Advanced tab, then click Environment Variables. The following dialog box appears:

In the Variable box, enter “UDT_LANG.” In the value box, enter the lan-guage, 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

Page 82: UniData - Rocket Software · : 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

7. Start UniDataYou 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/startudUsing UDTBIN=/disk1/ud71/bin

All output and error logs have been savedto /disk1/ud71/bin/saved_logs directory.

SMM is started.SBCS is started.CLEANUPD is started.SM is started.

UniData R7.2 has been started.:

8. Start a UniData SessionChange directories to the demo account and start a UniData session.Your session starts in the new language. Future sessions will also start in the des-ignated language, until you change UDT_LANG, or use SET.LANG in a running session.

9. Edit the DEFAULTS RecordChange 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, “Customizing UniData International,” for instructions.

5-14 UniData International

Page 83: UniData - Rocket Software · : 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

UniBasic Multibyte SupportThis 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 singlebyte languages, because, for these languages, one byte represents each character.

Modified Functions and CommandsThe 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

Page 84: UniData - Rocket Software · : 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

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 single-byte 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.

Function Comment

UniBasic Character Recognition Functions (continued)

5-16 UniData International

Page 85: UniData - Rocket Software · : 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

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 FunctionsThe functions listed here may not work properly when used with a multibyte character set.

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.

Function Comment

ALPHA Because UniBasic does not recognize multibyte characters as alpha-betic, 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

Function Comment

UniBasic Character Recognition Functions (continued)

5-17

Page 86: UniData - Rocket Software · : 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

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 FunctionsThe following UniBasic functions are designed for use with multibyte character sets.

UniBasic Functions for Multibyte Languages

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.

Note: The examples used here are graphical representations of multibyte character strings.

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.

Function Comment

Single-Byte Functions (continued)

5-18 UniData International

Page 87: UniData - Rocket Software · : 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

BYTELEN

SyntaxBYTELEN (string)

DescriptionThis UniBasic function returns the number of bytes required to store a character. From one to four bytes may be required.

ExampleThe 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.

2 3 1 2Number of bytes

5-19

Page 88: UniData - Rocket Software · : 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

CHARLEN

SyntaxCHARLEN (string)

DescriptionThis UniBasic CHARLEN function returns the number of characters in a character string. A multibyte character may require from one to four bytes to encode.

ExampleThe following is a representation of a string of four multibyte characters. CHARLEN would return 4 for this string.

2 3 1 2Number of bytes

5-20 UniData International

Page 89: UniData - Rocket Software · : 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

DISPLAYWIDTH

SyntaxDISPLAYWIDTH (string)

DescriptionThis 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.

ExampleThe 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.

2 3 1 2Number of bytes

5-21

Page 90: UniData - Rocket Software · : 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

ISMB

SyntaxISMB()

DescriptionThis 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

Page 91: UniData - Rocket Software · : 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

LEN

SyntaxLEN(str.expr)

DescriptionThe 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.

ExamplesIn 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.

2 3 1 2Number of bytes

5-23

Page 92: UniData - Rocket Software · : 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

MBLEN

SyntaxMBLEN (string expression)

DescriptionThis UniBasic function returns the number of bytes in the first character of a string.

ExampleThe 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.

2 3 1 2Number of bytes

5-24 UniData International

Page 93: UniData - Rocket Software · : 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

AAppendix

UniData and UNIX Locale

An important element in UniData International is the system-level 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 configu-ration 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.

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 # Language group 1 ENGLISH C # US English ENGLISH_UK english # UK English END BEGIN 159/130/129 # Language group 2 ENGLISH_G2 C # Group 2 English JAPANESE japanese.euc # EUC Japanese FRENCH french # French END

Page 94: UniData - Rocket Software · : 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

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 -aen_US.ISO8859-1En_US.IBM-850de_CH.ISO8859-1De_CH.IBM-850de_DE.ISO8859-1De_DE.IBM-850en_GB.ISO8859-1En_GB.IBM-850es_ES.ISO8859-1Es_ES.IBM-850fr_BE.ISO8859-1Fr_BE.IBM-850fr_CA.ISO8859-1Fr_CA.IBM-850fr_CH.ISO8859-1Fr_CH.IBM-850fr_FR.ISO8859-1Fr_FR.IBM-850ja_JP.IBM-eucJPen_JP.ISO8859-1Ja_JP.IBM-932En_JP.IBM-850zh_TW.ozh_TW.IBM-eucTW%

On most systems, the locale command without an argument displays a list similar to the following:

% localeLANG=CLC_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-2 Developing UniBasic Applications

Page 95: UniData - Rocket Software · : 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

The next example shows the LANG set for French:

% localeLANG=fr_FRLC_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.

Locale Variables

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.

A-3


Recommended