NLS Display Formats

For Numeric, Float, Date, Time, and DateTime data, the formatting rules that are applied depend on the NLS settings.

The NLS formatting rules are determined by:

  1. The NLS display format, if specified. If a $NLS format is used [DIS($NLS(NlsFormat))], the value of $nlslocale is used. For more information, see $NLS Display Formats for Numeric and Float and $NLS Display Formats for Date and Time.
  2. If a standard display format is specified, the value of $nlsformat is used, as set by the $NLS_FORMAT assignment setting or $nlsformat ProcScript function.
  3. If $nlsformat is not set, the value of $nlslocale is used, as set by $NLS_LOCALE or $nlslocale.
  4. If $nlslocale is not set, or is set to classic, data is displayed according to the standard display formats.
  5. If $nlslocale is set to a specific locale (language and country), locale-based rules are applied when displaying data.

For more information, see $nlslocale and $nlsformat.

Explicitly Apply Local-Based Formatting

To apply NLS formatting only where you want it, in the assignment file you can set the locale, but turn display formatting off:

[SETTINGS]
$NLS_LOCALE = system     ; use the language and locale of the local system
$NLS_FORMAT = classic    ; switch locale-based formatting off

In this case, you can override and apply NLS formatting on a case-by-case basis by using a $NLS display format. For example:

Display Format Shorthand Syntax Locale Displayed Data
DIS($NLS(FULL, DATIM)) en_US Tuesday, February 23, 2010 9:13:33 AM
en_GB Tuesday, 23 February 2010 09:13:33
fr_CA mardi 23 février 2010 09:13:33
DIS($NLS(FormatPattern))

For example:

DIS($NLS("Aa*, dd-Mmm*-yyyy"))

en_US Tuesday, 23-February-2010
en_GB Tuesday, 23-February-2010
fr_CA Mardi, 23-Février-2010

Related Topics