BookmarkSubscribeRSS Feed

SAS Code Analyzer for Internationalization

Started ‎04-16-2019 by
Modified ‎10-05-2022 by
Views 2,597

If you want to make your program run anywhere in the world, or you are migrating your SAS environment to a Unicode environment (UTF-8), you might need to internationalize your program. Internationalization is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes.


To internationalize your SAS program, you need to consider the following guidelines:

  • Avoid hardcoding text strings
  • Use locale-sensitive formats (NL-Formats)
  • Use character-based functions (K-Functions)

SAS Enterprise Guide provides a code analyzer that can help you. The SAS Code Analyzer for Internationalization (I18N) performs a static analysis of SAS statements in the code editor. The analyzer lists all statements that do not comply with I18N best practices for SAS programs. It also provides features that enable you to interactively fix I18N problems quickly.  (See I18N and L10N: Lazy terms for important work.)


In SAS Enterprise Guide v8.3, you'll find this feature "hidden" in the vertical ellipses menu on the edge of the program window:



This image shows the SAS Code Analyzer after it has analyzed a SAS program in the code editor.




In this example, the SAS Code Analyzer detects several potential I18N problems. The SCAN function is a byte-oriented function that assumes that every character in the data is only one-byte long. Because SCAN might not work well in the SAS UTF-8 (multi-byte) environment, the SAS Code Analyzer suggests the KSCAN function instead, which is a character-based function. In addition, the SAS Code Analyzer provides a one-click operation to fix the problem. When you press the “Insert Substitution” button, the SAS Code Analyzer replaces SCAN with the KSCAN function.


Sometimes the SAS Code Analyzer reports a potential problem that works correctly in the SAS UTF-8 environment. If you decide to keep your code, you can use the “Suppress” button to exclude the statement from further analysis.


To enable your SAS program to support multiple languages, you need to first remove hardcoded text strings from your SAS program. The SAS Code Analyzer will help you locate each hardcoded text string so that you can determine whether the string is one that you want to translate.


Several technical papers are available on the SAS web site, and they can help you to understand and fix I18N issues in your code.

The SAS Code Analyzer for Internationalization enables you to internationalize your code easily and quickly, increasing your productivity.


In addition to SAS Enterprise Guide, you can also find the Code Check for I18N in the SAS Content Assessment tool, which allows you to run the process on a group of files to generate a report of potential issues.


Version history
Last update:
‎10-05-2022 04:22 PM
Updated by:


Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Labels