You are here: Job and Form Set Rules Reference > JDT Rules Reference > SetLocale

SetLocale

Use this form set level rule (level 2) to change the default Locale setting for the transaction process until it is changed by a subsequent event. This transaction rule is specified in the AFGJOB. You should call this rule as early as possible if there are other transaction level events that need the value set before their execution.

The SetLocale rule executes on the "forward" message pass, meaning it executes before any section maps are executed.

Syntax

;SetLocale;;(parameters);

Parameter

Description

OPT(Y)

Set this parameter value first if the attempt to find a locale value is considered optional and should not generate an error if no locale setting is found. This parameter does not mean that subsequent parameters can be defined incorrectly. 

SRCH(...)

Search mask values followed by offset and length separated with a comma. Use this parameter to find the locale value directly within the extract data.

Examples:

Standard offset length search mask: SRCH(11,HEADERREC 119, 3)

xPath: SRCH(!//xpath 1,3)

XDD token lookup: SRCH(?XDDToken 1,3)

Any of the methods that can legally be defined as a search mask are permissible. If the length specified exceeds the maximum length allowed for locale settings, the data will be truncated. An incorrectly defined search mask will generate an error. If the OPT(Y) flag is not specified, an error will be generated if the search mask does not locate a record or returns no data.

DAL(script)

Execute the named DAL script and use the results as the locale value. Note this option's parameter is the name of a script file or DAL library routine. This option does not support direct inclusion of DAL statements within the parameter. If the OPT(Y) flag is not used, an error will occur if the called script returns no value.

GVM(variable)

Obtain the value for the locale from the named Global Variable. The GVM variable data must have been previously mapped before executing this rule. If the OPT(Y) flag is not used, an error will occur if the GVM named is not located or contains no value.

RESET(N) As a default, this transaction level rule will restore the original locale setting on the POST_PROC_A message (at the end of a transaction). If the subsequent transaction has no locale specified in the data and this is considered optional, that transaction will run with the system default locale. Using RESET(N) indicates that you do not want to restore the default on the post process. Subsequent transactions will inherit the locale set by the earlier transaction unless it was changed within the current transaction.

Notes

If you specify more than one search method, SRCH(), DAL, and/or GVM() in the data, the first one in sequence to provide the locale will be used. However, this does not mean the following parameters are not parsed for validity.

Any unexpected token parameters specified within the rule will generate warning messages, even if the OPT(Y) flag is set.