SAS 9.1 National Language Support (NLS) User's Guide
SAS® 9.1 National Language Support (NLS) User’s Guide The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2004. SAS ® 9.1 National Language Support (NLS): User’s Guide. Cary, NC: SAS Institute Inc. SAS® 9.1 National Language Support (NLS): User’s Guide Copyright © 2004, SAS Institute Inc., Cary, NC, USA ISBN 1-59047-194-6 All rights reserved. Produced in the United States of America. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc. U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of this software and related documentation by the U.S. government is subject to the Agreement with SAS Institute and the restrictions set forth in FAR 52.227–19 Commercial Computer Software-Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. 1st printing, January 2004 SAS Publishing provides a complete selection of books and electronic products to help customers use SAS software to its fullest potential. For more information about our e-books, e-learning products, CDs, and hard-copy books, visit the SAS Publishing Web site at support.sas.com/pubs or call 1-800-727-3228. SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies. Contents
What’s New vii Overview vii Details vii
PART1 NLS Concepts 1 Chapter 1 R National Language Support (NLS) 3 Overview to National Language Support 3 Definition of Localization and Internationalization 4
Chapter 2 R Locale for NLS 5 Overview of Locale Concepts for NLS 5 Specifying a Locale 6 Interaction between the LOCALE= and ENCODING= System Options 7
Chapter 3 R Encoding for NLS 9 Overview of Encoding for NLS 9 Difference between Encoding and Transcoding 12 Character Sets for Encoding in NLS 12 Common Encoding Methods 12 Standards Organizations for NLS Encodings 14 Code Point Discrepancies among EBCDIC Encodings 15 Collation Sequence 16 Determining the Encoding of a SAS Session and a Data Set 16 Default SAS Session Encoding 18 Setting the Encoding of a SAS Session 18 Encoding Behavior in a SAS Session 19
Chapter 4 R Transcoding for NLS 21 Overview to Transcoding 21 Common Reasons for Transcoding 21 Transcoding and Translation Tables 22 SAS Options That Transcode SAS Data 23 Transcoding between Operating Environments 23 Transcoding Considerations 24 Compatible and Incompatible Encodings 25 Preventing Transcoding 26
Chapter 5 R Double-Byte Character Sets (DBCS) 29 Overview to Double-Byte Character Sets (DBCS) 29 East Asian Languages 29 Specifying DBCS 30 Requirements for Displaying DBCS Character Sets 30 iv
When You Can Use DBCS Features 30 DBCS and SAS on a Mainframe 31 SAS Data Conversion between DBCS Encodings 31 Avoiding Problems with Split DBCS Character Strings 32 Avoiding Character Data Truncation by Using the CVP Engine 32
PART2 Data Set Options for NLS 35
Chapter 6 R Overview to Data Set Options for NLS 37 Data Set Options for NLS by Category 37
Chapter 7 R Data Set Options for NLS 39
PART3 Formats for NLS 45
Chapter 8 R Overview to Formats for NLS 47 International Date and Datetime Formats 47 European Currency Conversion 52 Formats for NLS by Category 54
Chapter 9 R Formats for NLS 63
PART4 Functions for NLS 205
Chapter 10 R Overview to Functions for NLS 207 Functions for NLS by Category 207
Chapter 11 R Functions for NLS 209
PART5 Informats for NLS 243
Chapter 12 R Overview to Informats for NLS 245 Informats for NLS by Category 245
Chapter 13 R Informats for NLS 249
PART6 Procedures for NLS 311
Chapter 14 R The DBCSTAB Procedure 313 Overview: DBCSTAB Procedure 313 Syntax: DBCSTAB Procedure 313 When to Use the DBCSTAB Procedure 314 Examples: DBCSTAB Procedure 315
Chapter 15 R The TRANTAB Procedure 319 Overview: TRANTAB Procedure 319 Concepts: TRANTAB Procedure 320 v
Syntax: TRANTAB Procedure 323 Examples: TRANTAB Procedure 329
PART7 System Options for NLS 345 Chapter 16 R Overview to SAS System Options for NLS 347 System Options for NLS by Category 347
Chapter 17 R System Options for NLS 349
PART8 Other Commands, Statements, and Procedure Statements for NLS 365
Chapter 18 R Overview to NLS Options Used in Commands, Statements, and Procedures 367 Commands, Statements, and Procedures for NLS by Category 367
Chapter 19 R Options for Commands, Statements, and Procedures for NLS 369
Chapter 20 R The TRANTAB Statement Used with Procedures 391
PART9 Values for Locale, Encoding, and Transcoding 395 Chapter 21 R Values for the LOCALE= System Option 397 LOCALE= and Default Values for DFLANG, DATESTYLE, and PAPERSIZE Options 397 Locale Values and Encoding Values for SBCS, DBCS, and Unicode 400
Chapter 22 R SAS System Options for Processing DBCS Data 405 Overview to System Options Used in a SAS Session for DBCS 405 DBCS Values for a SAS Session 405
Chapter 23 R Encoding Values in SAS Language Elements 407 Overview to SAS Language Elements That Use Encoding Values 407 SBCS, DBCS, and Unicode Encoding Values for Transcoding Data 407
Chapter 24 R Encoding Values for a SAS Session 413 OpenVMS Encoding Values 413 UNIX Encoding Values 414 Windows Encoding Values 415 z/OS Encoding Values 416
PART10 419 Appendix 1 R Recommended Reading 421 Recommended Reading 421
Glossary 423
Index 427 vi vii
What’s New
Overview