SAS syntax contains a set of 15 problematic characters called variants. The variants appear in every encoding that SAS supports, but they can occupy different code points on different EBCDIC code pages. For example, in Swedish EBCDIC encoding, the Latin uppercase A with a ring above occupies the same code point as the compiler encoding (US EBCDIC) of a dollar sign. In some contexts, the A with a ring above was treated as a dollar sign. In other contexts, it was treated as the Latin uppercase A with a ring above.
The following characters are considered variant because they might have different code positions in various encodings that SAS does not support.
(newline \n)
!#$@\[]^`{}|~
Therefore, the hexadecimal value for the character in one encoding might be different from the hexadecimal value in a different encoding.
Variant characters are used as tokens in SAS syntax for character formats, arrays, and so on. The use of variants has caused problems, especially when you download from the mainframe to ASCII-based platforms. The solution in SAS 6 was to use context-sensitive transcoding and to enable users to use alternate characters from their keyboards. For example, you can use a Latin uppercase A with a ring above instead of a dollar sign in a SAS program.
In SAS 8.2, a session encoding was implemented that addressed the problems that are posed by compiler variants and ensured compatibility with SAS 6 by introducing the NLSCOMPATMODE option. This option enables you to run current SAS programs and maintain compatibility with previous versions of SAS. The NONLSCOMPATMODE option turns off the NLS compatibility mode. When you select the NONLSCOMPATMODE option, all character data, including external data, SAS syntax, and user data, is processed using the ENCODING= option. In this mode, the encoding that SAS uses to process character data is the encoding that is set by the ENCODING= option or the LOCALE= option. This is the new default in SAS®9.
Please note that in some cases you might still have to use US EBCDIC values for variant characters exclusively, for example, in Perl regular expression (PRX) functions.
For more information about variant characters, see the SAS® 9.1 National Language Support (NLS) User's Guide or TS-653,
"Globalization and National Language Support for Your Version 8.2 SAS Environment."
Operating System and Release Information
| SAS System | Base SAS | CMS | 8.2 TS2M0 | |
| z/OS | 8.2 TS2M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.