GETPXLOCALE Function

Returns the POSIX locale value for a SAS locale.
Category: Locale

Syntax

GETPXLOCALE(<source>)

Required Argument

<source>
is an optional argument that specifies a locale name.

Details

The GETPXLOCALE function returns the POSIX locale value for a valid SAS locale name. If you specify an invalid locale name, then a null string is returned. If you do not specify a value for the <source> argument, then the function returns the POSIX name for the current SAS session. The length of the POSIX locale name is five characters. If the size of the variable that receives the value is less than five characters, the value is truncated.

Example

In the first example, the LOCALE= system option is set to French_France. In the second example, the <source> argument is set to German_Germany. In the third example, the <source> argument is set to English_United States.
Statements
Results
option locale=french_france;
locale=getpxLocale();
put locale;
fr_FR
locale=getpxLocale("german_germany");
put locale;
de_DE
locale=getpxLocale("english_unitedstates");
put locale;
en_US