ALTER-LOCALE
Syntax
ALTER-LOCALE [LOCALE={txt_lit _var|DEFAULT|SYSTEM}] [NUMBER-EDIT-MASK={txt_lit|_var|DEFAULT|SYSTEM}] [MONEY-EDIT-MASK={txt_lit|_var|DEFAULT|SYSTEM}] [DATE-EDIT-MASK={txt_lit|_var|DEFAULT|SYSTEM}] [INPUT-DATE-EDIT-MASK={txt_lit|_var|DEFAULT|SYSTEM}] [MONEY-SIGN={txt_lit|_var|DEFAULT|SYSTEM}] [MONEY-SIGN-LOCATION={txt_var|DEFAULT|SYSTEM|LEFT |RIGHT}] [THOUSAND-SEPARATOR={txt_lit|_var|DEFAULT|SYSTEM}] [DECIMAL-SEPARATOR={txt_lit|_var|DEFAULT|SYSTEM}] [DATE-SEPARATOR={txt_lit|_var|DEFAULT|SYSTEM}] [TIME-SEPARATOR={txt_lit|_var|DEFAULT|SYSTEM}] [EDIT-OPTION-NA={txt_lit|_var|DEFAULT|SYSTEM}] [EDIT-OPTION-AM={txt_lit|_var|DEFAULT|SYSTEM}] [EDIT-OPTION-PM={txt_lit|_var|DEFAULT|SYSTEM}] [EDIT-OPTION-BC={txt_lit|_var|DEFAULT|SYSTEM}] [EDIT-OPTION-AD={txt_lit|_var|DEFAULT|SYSTEM}] [DAY-OF-WEEK-CASE={txt_var|DEFAULT|SYSTEM|UPPER|LOWER |EDIT|NO-CHANGE}] [DAY-OF-WEEK-FULL=({txt_lit1|_var1}...{txt_lit7 |_var7})] [DAY-OF-WEEK-SHORT=({txt_lit1|_var1}...{txt_lit7 |_var7})] [MONTHS-CASE={txt_var|DEFAULT|SYSTEM|UPPER|LOWER|EDIT |NO-CHANGE}] [MONTHS-FULL=({txt_lit1|_var1}...{txt_lit12| _var12})] [MONTHS-SHORT=({txt_lit1|_var1}...{txt_lit12|_var12})]
Description
Selects a locale or changes locale parameters used for printing date, numeric, and money data and for data accepted by the INPUT command. A locale is a set of preferences for language, currency, and presentation of charts and numbers.
The SYSTEM locale represents the behavior of older versions of SQR prior to Version 4.0. When you install SQR for PeopleSoft Version 4.0 or later, the default locale is set to SYSTEM. This provides upwards compatibility for older SQR programs. This table describes the SYSTEM locale settings:
| Keyword | Value |
|---|---|
|
NUMBER-EDIT-MASK |
The PRINT command prints two digits to the right of the decimal point and left-justifies the number in the field. The MOVE, SHOW, and DISPLAY commands format the number with six digits to the right of the decimal point and left-justify the number. |
|
MONEY-EDIT-MASK |
SQR uses the same default as the NUMBER-EDIT-MASK keyword. |
|
DATE-EDIT-MASK |
SQR uses the default database date format. See the Date Time section for more details. |
|
INPUT-DATE-EDIT-MASK |
SQR uses a default date edit mask with the INPUT command. See the Sample Date Edit Masks table for a listing of the date edit mask. |
|
MONEY-SIGN |
'$' |
|
MONEY-SIGN-LOCATION |
LEFT |
|
THOUSAND-SEPARATOR |
',' |
|
DECIMAL-SEPARATOR |
'.' |
|
DATE-SEPARATOR |
'/' |
|
TIME-SEPARATOR |
':' |
|
EDIT-OPTION-NA |
'NA' |
|
EDIT-OPTION-AM |
'am' |
|
EDIT-OPTION-PM |
'pm' |
|
EDIT-OPTION-BC |
'bc' |
|
EDIT-OPTION-AD |
'ad' |
|
DAY-OF-WEEK-CASE |
EDIT |
|
DAY-OF-WEEK-FULL |
('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday') |
|
DAY-OF-WEEK-SHORT |
('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') |
|
MONTHS-CASE |
EDIT |
|
MONTHS-FULL |
('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December') |
|
MONTHS-SHORT |
('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec') |
Parameters
The following table lists and describes the parameters:
Note:
Many of the settings can have a value of DEFAULT or SYSTEM . For a given setting, specifying DEFAULT retrieves the value from the corresponding setting of the default locale as identified in the Default-Settings section of the pssqr.ini file. Similarly, specifying SYSTEM retrieves the value from the corresponding setting of the system locale. You can alter the system locale using the ALTER-LOCALE command; however, you cannot define it in the pssqr.ini file.
| Parameter | Description |
|---|---|
|
LOCALE |
Specifies the name of the locale to use. This name must be defined in the pssqr.ini file. If this field is omitted, then the current locale is used. The locale name is not case-sensitive and is limited to the following character set: A–Z, 0–9, underscore, and hyphen. The current locale can be determined by printing the reserved variable $sqr-locale. |
|
NUMBER-EDIT-MASK |
Specifies the numeric edit mask to use with the keyword NUMBER in a PRINT, MOVE, SHOW, or DISPLAY command. |
|
MONEY-EDIT-MASK |
Specifies the numeric edit mask to use with the keyword MONEY in a PRINT, MOVE, SHOW, or DISPLAY command. |
|
DATE-EDIT-MASK |
The default date edit mask to use with the keyword DATE in the PRINT, MOVE, SHOW, or DISPLAY command, or the LET function datetostr() or strtodate(). |
|
INPUT-DATE-EDIT-MASK |
The default date format to use with the INPUT command when TYPE=DATE is specified with the command or the input variable is a date variable. For information about edit masks, see PRINT. |
|
MONEY-SIGN |
Specifies the characters that replace the $ or other currency symbol used in edit masks. |
|
MONEY-SIGN-LOCATION |
Specifies where to place the MONEY-SIGN characters. Valid values are LEFT and RIGHT. |
|
THOUSAND-SEPARATOR |
Specifies the character to replace the ',' edit character. |
|
DECIMAL-SEPARATOR |
Specifies the character to replace the '.' edit character. |
|
DATE-SEPARATOR |
Specifies the character to replace the '/' character. |
|
TIME-SEPARATOR |
Specifies the character to replace the ':' character. |
|
EDIT-OPTION-NA |
Specifies the characters to use with the 'na' option. |
|
EDIT-OPTION-AM |
Specifies the characters to replace 'AM'. |
|
EDIT-OPTION-PM |
Specifies the characters to replace 'PM'. |
|
EDIT-OPTION-BC |
Specifies the characters to replace 'BC'. |
|
EDIT-OPTION-AD |
Specifies the characters to replace 'AD'. |
|
DAY-OF-WEEK-CASE |
Specifies how the case for the DAY-OF-WEEK-FULL or DAY-OF-WEEK-SHORT entries is affected when used with the format codes 'DAY' or 'DY'. Valid values are UPPER, LOWER, EDIT, and NO-CHANGE. UPPER and LOWER force the output to either all uppercase or lowercase, ignoring the case of the format code in the edit mask. Use EDIT to follow the case specified with the format code in the edit mask. Use NO-CHANGE to ignore the case of the format code and output the day of week explicitly listed in the DAY-OF-WEEK-FULL or DAY-OF-WEEK-SHORT entries. |
|
DAY-OF-WEEK-FULL |
Specifies the full names for the days of the week. SQR considers the first day of the week to be Sunday. You must specify all seven days. |
|
DAY-OF-WEEK-SHORT |
Specifies the abbreviated names for the days of the week. SQR considers the first day of the week to be Sunday. You must specify all seven abbreviations. |
|
MONTHS-CASE |
Specifies how the case for the MONTHS-FULL or MONTHS-SHORT entries is affected when used with the format code 'MONTH' or 'MON'. Valid values are UPPER, LOWER, EDIT, and NO-CHANGE. UPPER and LOWER force the output to either all uppercase or lowercase, ignoring the case of the format code in the edit mask. Use EDIT to follow the case specified with the format code in the edit mask. Use NO-CHANGE to ignore the case of the format code and format the month explicitly listed in the MONTHS-FULL or MONTHS-SHORT entries. |
|
MONTHS-FULL |
Specifies the full names for the months of the year. SQR for PeopleSoft considers the first month of the year to be January. You must specify all 12 months. |
|
MONTHS-SHORT |
Specifies the abbreviated names for the months of the year. SQR for PeopleSoft considers the first month of the year to be January. You must specify all 12 abbreviations. |
Example
The following example illustrates the ALTER-LOCALE command:
!
! The following program segments will illustrate the various
! ALTER-LOCALE features.
!
begin-setup
declare-variable
date $date $date1 $date2 $date3
end-declare
end-setup
!
! Set default masks
!
alter-locale
number-edit-mask = '9,999,999.99'
money-edit-mask = '$999,999,999.99'
date-edit-mask = 'Mon DD, YYYY'
let #value = 123456
let $edit = 'Mon DD YYYY HH:MI:SS'
let $date = strtodate('Jan 01 2004 11:22:33', $edit)
show 'With NUMBER option #Value = ' #value number
show 'With MONEY option #Value = ' #value money
show 'Without NUMBER option #Value = ' #value
show 'With DATE option $Date = ' $date date
show 'Without DATE option $Date = ' $date
Produces the following output:
With NUMBER option #Value = 123,456.00
With MONEY option #Value = $ 123,456.00
Without NUMBER option #Value = 123456.000000
With DATE option $Date = Jan 01, 2004
Without DATE option $Date = 01-JAN-04
!
! Reset locale to SQR defaults and assign a multi-character
! money-sign.
!
alter-Locale
locale = 'System'
money-sign = 'AU$' ! Australian dollars
let #value = 123456
show #value edit '$999,999,999,999.99'
show #value edit '$$$$,$$$$999,999.99'
Produces the following output:
AU$ 123,456.00
AU$123,456.00
!
! Move the money-sign to the right side of the value. Note
! the leading space.
!
alter-locale
money-sign = ' AU$' ! Australian dollars
money-sign-location = right
let #value = 123456
show #value edit '$999,999,999,999.99'
show #value edit '$$$$,$$$$999,999.99'
Produces the following output:
123,456.00 AU$
123,456.00 AU$
!
! Reset locale to SQR defaults and flip the thousand and
! decimal separator characters.
!
alter-locale
locale = 'System'
thousand-separator = '.'
decimal-separator = ','
let #value = 123456
show #value edit '999,999,999,999.99'
Produces the following output:
123.456,00
!
! Reset locale to SQR defaults and change the date and time
! separators
!
alter-locale
locale = 'System'
date-separator = '-'
time-separator = '.'
let $edit = 'Mon/DD/YYYY HH:MI:SS'
let $date = strtodate('Jan/01/2004 11:22:33', $edit)
show $date edit :$edit
Produces the following output:
Jan-01-2004 11.22.33
!
! Reset locale to SQR defaults and change the text used with
! the edit options 'na', 'am', 'pm', 'bc, 'ad'
!
alter-locale
locale = 'System'
edit-option-na = 'not/applicable'
edit-option-am = 'a.m.'
edit-option-pm = 'p.m.'
edit-option-bc = 'b.c.'
edit-option-ad = 'a.d.'
let $value = ''
let $edit = 'Mon DD YYYY HH:MI'
let $date1 = strtodate('Jan 01 2004 11:59', $edit)
let $date2 = strtodate('Feb 28 2004 12:01', $edit)
show $value edit '999,999,999,999.99Na'
show $date1 edit 'Mon DD YYYY HH:MI:SS PM'
show $date2 edit 'Mon DD YYYY HH:MI:SS pm'
Produces the following output:
Not/Applicable
Jan 01 2004 11:59:00 A.M.
Feb 28 2004 12:01:00 p.m.
!
! Input some dates using the 'system' locale and
! output using other locales from the PSPSPSSQR.INI file.
!
alter-locale
locale = 'System'
let $date1 = strtodate('Jan 01 2004', 'Mon DD YYYY')
let $date2 = strtodate('Feb 28 2004', 'Mon DD YYYY')
let $date3 = strtodate('Mar 15 2004', 'Mon DD YYYY')
show 'System:'
show
show $date1 edit 'Month DD YYYY' ' is ' $date1 edit 'Day'
show $date2 edit 'Month DD YYYY' ' is ' $date2 edit 'Day'
show $date3 edit 'Month DD YYYY' ' is ' $date3 edit 'Day'
alter-locale
locale = 'German'
show
show 'German:'
show
show $date1 edit 'DD Month YYYY' ' ist ' $date1 edit 'Day'
show $date2 edit 'DD Month YYYY' ' ist ' $date2 edit 'Day'
show $date3 edit 'DD Month YYYY' ' ist ' $date3 edit 'Day'
alter-locale
locale = 'Spanish'
show
show 'Spanish:'
show
show $date1 edit 'DD Month YYYY' ' es ' $date1 edit 'Day'
show $date2 edit 'DD Month YYYY' ' es ' $date2 edit 'Day'
show $date3 edit 'DD Month YYYY' ' es ' $date3 edit 'Day'
Produces the following output:
System:
January 01 2004 is Thursday
February 28 2004 is Saturday
March 15 2004 is Monday
German:
01 Januar 2004 ist Donnerstag
28 Februar 2004 ist Samstag
15 März 2004 ist Montag
Spanish:
01 enero 2004 es jueves
28 febrero 2004 es sábado
15 marzo 2004 es lunes
See DISPLAY , LET, MOVE ,PRINT, SHOW
Related Topics