900-IS-VALID-LOCALE

900-IS-VALID-LOCALE validates a LOCALE. 900-IS-VALID-LOCALE checks the LOCALE table for valid records.

LOCALE names are uppercase only. Input given in mixed case is converted to all uppercase when checking against the LOCALE table records.

Library DATABASE

Required Field

Field Type and length Definition
CRT-LOCALE A 30 Locale to be verified.

Return Value

Field Type and length Definition
CRT-IS-VALID-LOCALE A 1

Y = The locale is valid.

N = The locale is invalid.

Note: 

SPACES is a valid locale and returns Y. It represents the default locale set up at a given location.

Programming Example

Before using this API, make sure that any needed language codes have been created through the Language Definition utility (langdef).

Note: Spaces indicate the base language at the client site.
    IF (AR19F4-ANT-LANGUAGE-CODE (I1) NOT = SPACES)
    MOVE AR19F4-ANT-LANGUAGE-CODE (I1) TO CRT-LOCALE
    PERFORM 900-IS-VALID-LOCALE
    IF (CRT-IS-VALID-LOCALE NOT = "Y")
        MOVE 110                       TO CRT-ERROR-NBR
        MOVE AR19F4-ANT-LANGUAGE-CODE-FN (I1)
                                       TO CRT-FIELD-NBR