Specify comma as decimal separator in all outputs (SAS 9.4)

2.2k views Asked by At

My data has '.' as decimal separator, but that's not the problem for me.

enter image description here

I want all outputs in SAS to use comma as decimal separator, and use dot as 3-digit separator, but I don't find a global option to do that.

I'm doing a PROC LOGISTIC and I want to show numbers with comma separator, no matter the format of the original data. Is that possible?

PROC LOGISTIC DATA=BD DESCENDING;

MODEL DESFECHO=IDADE /LINK=GLOGIT;

RUN;

enter image description here

1

There are 1 answers

1
Joe On

Relevant options:

NLDECSEPARATOR option - tells SAS to respect the locale when deciding what separator to use

LOCALE option - tells SAS what country/etc. you're "in"

NLNUM format - one format that tells SAS to respect the locale

Different combinations of these will work... for example, this works:

options locale="FR_FR";
options NLDECSEPARATOR ;
data test;
  x = 3.5;
  output;
run;

proc print data=test;
run;

As does this:

options locale="FR_FR";

data test;
  x = 3.5;
  format x nlnum6.2;
  output;
run;

proc print data=test;
run;

The key is the locale (which may well be already set at startup), and then one of the other options to tell SAS you care about the decimal.