简体   繁体   中英

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

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

在此处输入图像描述

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;

在此处输入图像描述

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM