U@ISVALLOCALE

U@ISVALLOCALE validates a LOCALE. U@ISVALLOCALE 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.

Module DATABASE

Required Field

Field Type and length Definition
E@LOCALE A 30 Locale to be verified.

Return Value

Field Type and length Definition
E@ISVALLOCALE A 1

Y = The locale is valid.

N = The locale is invalid.

Note:  *BLANKS 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: The value of *BLANKS indicates the base language at the client site.
      IF        F4@ANLNCD(I1) <> *BLANKS         
      EVAL      E@LOCALE       = F4@ANLNCD(I1)              
      CALLP     U@ISVALLOCALE                Is Valid Locale
      IF        E@ISVALLOCALE <> 'Y'                        
      EVAL      E@ERRORNBR     = 110                        
      EVAL      E@FIELDNBR     = F4FN@ANLNCD(I1)