Selects a locale or changes locale parameters for printing date, numeric, and money data and for data accepted by INPUT. Locales are preferences for language, currency, and the presentation of charts and numbers.
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})]
Many of the settings can have a value of DEFAULT or SYSTEM. DEFAULT retrieves values from the corresponding setting of the default locale in the [Default‑Settings] section of SQR.INI. SYSTEM retrieves values from the corresponding setting of the system locale. You can alter the system locale using ALTER-LOCALE; however, you cannot define it in SQR.INI.
Locale name. This name must be defined in SQR.INI. If omitted, the current locale is used. The locale name is case-insensitive and is limited to A-Z, 0-9, underscore, or hyphen. To determine the current locale, print the reserved variable $sqr-locale.
Numeric edit mask used with the keyword NUMBER in PRINT, MOVE, SHOW, or DISPLAY.
Numeric edit mask used with the keyword MONEY in PRINT, MOVE, SHOW, or DISPLAY.
Date edit mask used with the keyword DATE in PRINT, MOVE, SHOW, or DISPLAY, or the LET functions datetostr() or strtodate().
Default date format to use with INPUT when TYPE=DATE is specified or the input variable is a date variable.
Note:
For more information on Edit Masks, see “Edit Masks”.
Character(s) that replace $ or other currency symbols used in edit masks.
Where to place the MONEY-SIGN character(s). Valid values are LEFT and RIGHT.
Character to replace the ',' edit character.
Character to replace the '.' edit character.
Character to replace the '/' character.
Character to replace the ':' character.
Character(s) to use with the 'na' option.
Character(s) to replace 'AM'.
Character(s) to replace 'PM'.
Character(s) to replace 'BC'.
Character(s) to replace 'AD'.
How the case for DAY-OF-WEEK-FULL or DAY‑OF-WEEK-SHORT is affected when used with 'DAY' or 'DY'. Valid values are:
UPPER, LOWER—Forces output to all uppercase or lowercase, ignoring the case of the format code in the edit mask.
EDIT—Uses the case specified with the format code in the edit mask.
NO‑CHANGE—Ignores the case of the format code and outputs the day of week defined in DAY‑OF‑WEEK‑FULL or DAY-OF-WEEK-SHORT.
Full names for the days of the week. Production Reporting considers the first day to be Sunday. You must specify all seven days.
Abbreviated names for the days of the week. Production Reporting considers the first day to be Sunday. You must specify all seven abbreviations.
How the case for MONTHS-FULL or MONTHS‑SHORT is affected when used with 'MONTH' or 'MON'. Valid values are:
UPPER, LOWER—Forces output to all uppercase or lowercase, ignoring the case of the format code in the edit mask.
EDIT—Uses the case specified with the format code in the edit mask.
NO-CHANGE—Ignores the case of the format code and outputs the month defined in MONTHS‑FULL or MONTHS‑SHORT
Full names for the months of the year. Production Reporting considers the first month to be January. You must specify all 12 months.
Abbreviated names for the months of the year. Production Reporting considers the first month to be January. You must specify all 12 abbreviations.
When you install Production Reporting, the default locale is set to SYSTEM.
Table 6. SYSTEM Locale Settings
PRINT prints two digits to the right of the decimal point and left justifies the number. MOVE, SHOW, and DISPLAY format the number with six digits to the right of the decimal point and left justifies the number. | |
Date formats in Table 61, Default Formats by Database. | |
Date edit masks in Table 59, Sample Date Edit Masks. | |
('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday') | |
('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December') | |
('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec') |
! ! 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 1995 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, 1995 Without DATE option $Date = 01-JAN-95
! ! Reset locale to Production Reporting 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:
! ! 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:
! ! Reset locale to Production Reporting 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 Production Reporting 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/1995 11:22:33', $edit) show $date edit :$edit
Produces the following output:
Jan-01-1995 11.22.33
! ! Reset locale to Production Reporting 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 1995 11:59', $edit) let $date2 = strtodate('Feb 28 1995 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:
! ! Input some dates using the 'system' locale and ! output using other locales from the SQR.INI file. ! alter-locale locale = 'System' let $date1 = strtodate('Jan 01 1995', 'Mon DD YYYY') let $date2 = strtodate('Feb 28 1995', 'Mon DD YYYY') let $date3 = strtodate('Mar 15 1995', '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'