15.00 - SDF File - Teradata Database

Teradata Database Utilities

Product
Teradata Database
Release Number
15.00
Content Type
Configuration
Publication ID
B035-1102-015K
Language
English (United States)
Last Update
2018-09-25

SDF File

The SDF file is a text file that defines how Teradata Database formats numeric, date, time, and currency output. The formatting strings it contains are used in conjunction with special formatting characters used in SQL FORMAT output phrases.

Teradata Database includes a default SDF file that contains a viewable and editable text version of the default output formatting settings. The default SDF file is located in /usr/tdbms/etc.

The SDF file controls how the following kinds of information are formatted in the output of Teradata Database.

  • Day names
  • Month names
  • AM and PM names
  • Numeric and currency separators
  • Numeric and currency digit grouping rules
  • Currency symbols
  • Default display formats for data types
  • The SDF file also controls the default display formats for the following data types:

  • BYTEINT
  • SMALLINT
  • BIGINT
  • INTEGER
  • NUMERIC (includes DECIMAL)
  • REAL (includes DOUBLE PRECISION and FLOAT)
  • DATE
  • TIME and TIME WITH TIME ZONE
  • TIMESTAMP and TIMESTAMP WITH TIME ZONE
  • NUMBER
  • Note: You cannot use the SDF file to control output formatting for the INTERVAL data type.

    The formatting characters permitted in the format strings of the SDF file are the same formatting characters permitted in an SQL FORMAT for the data types listed above. You can override the default display format for a data type in the SDF file by using the FORMAT output phrase in a CREATE TABLE, ALTER TABLE, or SELECT statement in SQL.

    SDF quoted strings are delimited by the quotation mark (U+0022) and can specify almost any Unicode character accepted by Teradata Database. However note the following restrictions:

  • Characters within SDF quoted strings are limited to the printable 7-bit ASCII characters (U+0020, U+0021 and U+0023 through U+007E). The quotation mark itself (U+0022) cannot be used within an SDF quoted string.
  • The reverse solidus (\) character(U+005C) does not represent itself, but instead can be used to specify Unicode characters above U+009F. The sequence \uXXXX specifies the corresponding Unicode character U+ XXXX, where XXXX is the hexadecimal for the Unicode character.
  • Formats are restricted to valid formats as specified inSQL Data Types and Literals.

    For example, you can set the value of the currency string in the SDF file to the currency symbol native to your locale. To include that currency symbol when you display numeric monetary information in an SQL SELECT statement, use the L formatting character in the FORMAT output phrase. For more information on display formats and SQL output format phrases, see SQL Data Types and Literals.

    Additionally, the SDF file can be used to specify a time zone string, which allows Teradata Database to automatically adjust the system time for locales that use Daylight Savings Time.

    SDF Elements

    The following table describes the SDF elements. All elements must be specified once in the SDF file. Keywords are case insensitive, but the data strings are case sensitive, unless stated otherwise. The SDF format strings consist of printable characters from 7-bit ASCII, unless an element is restricted further by the type of data. For out-of-range characters, use the \u Unicode hex notation. The SDF can contain single-line comments that start with //.

     

    Syntax element ...

    Description

    short_day_name is one of seven abbreviated names for the days of the week in the native language.

    These names can vary in length. You must have seven.

    Example:

    ShortDays {"Sun";"Mon";"Tue";"Wed";"Thu";
    "Fri";"Sat"}

    long_day_name is one of seven full names for the days of the week in the native language.

    The order of the names must match the order of the names of the ShortDays. These names can vary in length. You must have seven.

    Example:

    LongDays {"Sunday";"Monday";"Tuesday";
    "Wednesday";"Thursday";"Friday";
    "Saturday"}

    short_month_name is one of 12 abbreviated names for the months of the year in the native language.

    These names can vary in length.You must have 12.

    Example:

    ShortMonths {"Jan";"Feb";"Mar";"Apr";
    "May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov";
    "Dec"}

    long_month_name is one of 12 full names for the months of the year in the native language.

    The order of the names must match the order of the names of the ShortMonths. These names can vary in length. You must have 12.

    Example:

    LongMonths {"January";"February";"March"; "April";"May";"June";"July";"August"; "September";"October";"November";
    "December"}

    am_name is the abbreviated name for AM (ante meridiem), and pm_name is the abbreviated name for PM (post meridiem) in the native language.

    These names can vary in length. You must have both.

    Example:

    AMPM {"AM";"PM"}

    radix_separator_character is a character that separates the integer and fractional part of non-monetary strings. Separators cannot contain the following:

  • plus sign (+)
  • minus sign (-)
  • digits (0 through 9)
  • E
  • e
  • V
  • v
  • The radix_separator_character must be different than the group_separator_character. However, the radix_separator_character can be the same as the currency_radix_separator_character.

    Example:

    RadixSeparator {"."}

    group_separator_character is a character that separates groups of digits in the integer part of non-monetary strings.

    Separators cannot contain the following:

  • plus sign (+)
  • minus sign (-)
  • digits (0 through 9)
  • E
  • e
  • The group_separator_character can be the same as the currency_group_separator_character.

    Example:

    GroupSeparator {","}

    grouping_rule_number is a group of numbers that defines the size of each group of digits in non-monetary strings.

    The size of each group can vary. Each number specifies how many digits are in each group with the initial integer defining the size of the group immediately preceding the radix separator, and the following integers defining groups preceding that.

  • If the last integer is -1, no further grouping shall be performed.
  • If the last integer is not -1, the size of the previous group (if any) shall be repeatedly used for the remainder of the digits.
  •  

    Examples:

    GroupingRule {"3"}

    For GroupingRule {“3”}, the numeric value 123456789.00 is formatted as 123,456,789.00.

    GroupingRule {"3,2,-1"}

    For GroupingRule {“3,2,-1”}, the numeric value 123456789.00 is formatted as 1234,56,789.00.

    currency_symbol is string representing the local currency.

    Currencies cannot contain the following:

  • plus sign (+)
  • minus sign (-)
  • digits
  • CurrencyRadixSeparator
  • CurrencyGroupSeparator
  • E (by itself)
  • e (by itself)
  • percent sign (%)
  • comma (,)
  • dot (.)
  • slash (/)
  • colon (:)
  • Example:

    Currency {"$"}

    iso_currency_abbrev is a string representing the local currency as an uppercase three-character code from ISO 4217.

    You are responsible for verifying that the string is specified in ISO 4217.

    Currencies cannot contain the following:

  • plus sign (+)
  • minus sign (-)
  • digits
  • CurrencyRadixSeparator
  • CurrencyGroupSeparator
  • E (by itself)
  • e (by itself)
  • percent sign (%)
  • comma (,)
  • dot (.)
  • slash (/)
  • colon (:)
  • Example:

    ISOCurrency {"USD"}

    currency_name is a string representing the local currency as a completely spelled out currency name.

    Currencies cannot contain the following:

  • plus sign (+)
  • minus sign (-)
  • digits
  • CurrencyRadixSeparator
  • CurrencyGroupSeparator
  • E (by itself)
  • e (by itself)
  • percent sign (%)
  • comma (,)
  • dot (.)
  • slash (/)
  • colon (:)
  • Example:

    CurrencyName {"US Dollars"}

    currency_radix_separator_character is a character that separates the integer and fractional part of monetary strings.

    Separators cannot contain the following:

  • plus sign (+)
  • minus sign (-)
  • digits
  • E
  • e
  • V
  • v
  • The currency_radix_separator_character must be different that the currency_group_separator_character.

    Example:

    CurrencyRadixSeparator {"."}

    currency_group_separator_character is a character that separates groups of digits in the integer part of monetary strings.

    Separators cannot contain the following:

  • plus sign (+)
  • minus sign (-)
  • digits
  • E (by itself)
  • e (by itself)
  • Example:

    CurrencyGroupSeparator {","}

    currency_grouping_rule_number is a string of comma-separated numbers defining the size of each group of digits in monetary strings.

    The size of each group can vary. Each number specifies how many digits are in each group with the initial integer defining the size of the group immediately preceding the radix separator, and the following integers defining groups preceding that.

    Example:

    CurrencyGroupingRule {"3"}

    dual_currency_symbol is a string representing the dual currency.

    Currencies cannot contain the following:

  • plus sign (+)
  • minus sign (-)
  • digits
  • CurrencyRadixSeparator
  • CurrencyGroupSeparator
  • E (by itself)
  • e (by itself)
  • percent sign (%)
  • comma (,)
  • dot (.)
  • slash (/)
  • colon (:)
  • Example:

    DualCurrency {"$"}

    dual_iso_currency_abbrev is a string representing the dual currency as a three-character code from ISO 4217.

    You are responsible for verifying that the string is specified in ISO 4217.

    Currencies cannot contain the following:

  • plus sign (+)
  • minus sign (-)
  • digits
  • CurrencyRadixSeparator
  • CurrencyGroupSeparator
  • E (by itself)
  • e (by itself)
  • percent sign (%)
  • comma (,)
  • dot (.)
  • slash (/)
  • colon (:)
  • Example:

    DualISOCurrency {"USD"}

    dual_currency_name is a string representing the dual currency as a completely spelled out currency name.

    Currencies cannot contain the following:

  • plus sign (+)
  • minus sign (-)
  • digits
  • CurrencyRadixSeparator
  • CurrencyGroupSeparator
  • E (by itself)
  • e (by itself)
  • percent sign (%)
  • comma (,)
  • dot (.)
  • slash (/)
  • colon (:)
  • Example:

    DualCurrencyName {"US Dollars"}

    byteint_default_format is a string representing the default format applied to BYTEINT data types.

    Example:

    BYTEINT {"-(3)9"}

    integer_default_format is a string representing the default format applied to INTEGER data types.

    Example:

    INTEGER {"-(10)9"}

    small_integer_default_format is a string representing the default format applied to SMALLINT data types.

    Example:

    SMALLINT {"-(5)9"}

    big_integer_default_format is a string representing the default format applied to BIGINT data types.

    Example:

    BIGINT {"-(19)9"}

    numeric_decimal_default_format is a string representing the default format applied to NUMERIC and DECIMAL data types.

    Example:

    NUMERIC {"--(I).9(F)"}
  • I represents the number of characters needed to display the integer portion of NUMERIC and INTEGER data. For example:
  • With INTEGER type, I is 10.
  • With DECIMAL type (10,2), I is 8
  • F represents the number of characters required to display the fractional portion of NUMERIC data. For example, with DECIMAL type (10,2), F is 2.
  • real_default_format is a string representing the default format applied to REAL, DOUBLE PRECISION, and FLOAT data types.

    Example:

    REAL {"-9.99999999999999E-999"}

    date_default_format is a string representing the default format applied to DATE and PERIOD(DATE) data types.

    Example:

    DATE {"YY/MM/DD"}

    time_default_format is a string representing the default format applied to TIME, TIME WITH TIME ZONE, and PERIOD(TIME) data types.

    Example:

    TIME {"HH:MI:SS.S(F)Z"}

    timestamp_default_format is a string representing the default format applied to TIMESTAMP, TIMESTAMP WITH TIME ZONE, and PERIOD(TIMESTAMP) data types.

    Example:

    TIMESTAMP {"YYYY-MMDDBHH:MI:SS.S(F)Z"} 

    time_zone_string names a time zone or GMT offset.

    time_zone_rules is a sequence of strings that represents the time offset for the time zone.

    Example 1:

    {"GMT-8"; "-8"; "0"}

    Example 2:

    For locations that observe Daylight Savings Time (DST), the time_zone_rules can define when in the calendar year the system time zone offset should change. The system will automatically adjust for DST according to this code. For example:

    {"America Pacific"; "-8"; "0"; "2"; "4"; "4"; "1"; "0"; "0"; "02:00:00"; "3"; "10"; "0"; "0"; "-1"; "02:00:00"; "1987"; "2006"; "-8"; "0"; "-7"; "0"; "4"; "3"; "8"; "0"; "0"; "02:00:00"; "4"; "11"; "1"; "0"; "0"; "02:00:00";"2007"; "9999"; "-8"; "0"; "-7"; "0"}

    Note: Rules in sample time zone strings cover years from 1987 to 9999. If you need the rules to cover years prior to 1987, you can modify the samples and add additional rules.

    For more information on time zone strings and time zone rules, see SQL Functions, Operators, Expressions, and Predicates.

    Also refer to the sample time zone strings and rules in the file tdlocaledef_tzrules.txt, which is in
    /usr/tdbms/etc.

    number_default_format is a string representing the default format applied to NUMBER data types.

    Example:

    NUMBER {"FN9"}