IMSTAT Procedure (Analytics)

Generated Code and Locale Sensitivity

Several of the analytic statements offer a CODE option that can be used to produce and store code for analytic models. The code can be used for scoring data sets with the models.
Because formatting numeric variables with thousands separators and decimal points is locale-sensitive, in rare circumstances, the scoring code can be locale-sensitive too. This can occur when a numeric variable that takes on non-integral values is used as a classification or in a GROUPBY= option. The following code demonstrates how locale-specific code can be generated:
options locale=fr_FR;

data example.cars;
  set sashelp.cars;
run;

proc imstat data=example.cars;
  glm mpg_city = weight / groupby=(enginesize)
    code(file="/tmp/glmcars.sas" replace linesize=256);
quit;
For the SAS LASR Analytic Server 2.7 release, the locale is specified in the file header. For locales that are sensitive to the formatting of numeric variables, the NLBEST format is used. The following example is for fr_FR:
   /*------------------------------------------
   SAS Code Generated by LASR Analytic Server
     Date              : 02 juin 2015 12 h 54
     Locale            : fr_FR
     Model Type        : Regression
     Group-By variable : EngineSize
     Response variable : MPG_City
     ------------------------------------------*/

...
   length _EngineSize_ $12; drop _EngineSize_;
   _EngineSize_ = left(trim(put(EngineSize,NLBEST12.)));

...
     select (_EngineSize_);
      when ('1,3') do;
...
If the locale in which you intend to use the code does not match the locale specified in the file header, then you need to take some action. You can run the SAS program that produced the scoring code again in the preferred locale or you can modify the scoring code.