SAS экспортирует значения 0 как период в Excel - PullRequest
1 голос
/ 30 декабря 2011

У меня есть серьезная проблема.Я запускаю отчет в SAS, который сохраняет результаты в формате Excel.Проблема в том, что всякий раз, когда значение равно 0, sas заполняет столбец точкой (.)

Есть ли способ предотвратить это?Я хочу, чтобы SAS не заполнял значение 0.

Спасибо.

Ответы [ 3 ]

4 голосов
/ 31 декабря 2011

Без вашего кода трудно определить проблему. Если вы используете Proc Report или Proc Print, попробуйте:

Options Missing=0;
1 голос
/ 01 октября 2012

Вы можете использовать proc stdize.

Proc stdize data=base_data out=output_data reponly missing=0;run;
1 голос
/ 04 января 2012

Если вы действительно хотите изменить набор данных, используйте приведенное ниже и прочитайте документацию SAS по адресу http://support.sas.com/kb/24/693.html

/* Example 1 - Convert all numeric missing values to zero.           */
/*                                                                   */
/* Use the ARRAY statement with the automatic _NUMERIC_ variable to  */
/* process all the numeric variables from the input data set.  Use   */
/* the DIM function to set the upper bound of an iterative DO to the */
/* number of elements in the array.                                  */
/*                                                                   */
/* NOTE: The MISSING function can be used as well to test for        */
/*       character or numeric missing values.  If you have           */
/*       mixed data types and want to use arrays, you'll need one    */
/*       array for the character variables, and another array for    */
/*       numeric variables.                                          */
data nomiss(drop=i);                                                    
set ***YOUR DATA SET HERE***;                                                            
array testmiss(*) _numeric_;                                            
do i = 1 to dim(testmiss);                                              
if testmiss(i)=. then testmiss(i)=0;                                    
end; 
run;

Ответ CarolinaJay будет лучше, если проблема только в экспорте, поскольку она не меняет никаких значений.

...