Hello
I use ods tagsets.ExcelXp to export sas data set to XML sheet .
The null values appear with dot (.) symbol in the XML file.
What is the way to replace dot values(.) with empty values?
data ttbl;
input ID group $ Y;
cards;
1 a .
2 a .
3 a 30
4 a 40
5 b .
6 b 25
7 b 35.85
8 c 50
9 c 60
10 c .
;
run;
ods _all_ close;/*To prevent print on screen*/
ods tagsets.ExcelXp
File ='Ex3b.xml'
path="/My path/";
proc print data=ttbl noobs label;
run;
ods tagsets.ExcelXp close;
ods listing;
Okay, I found the answer. Need to use options missing=' ' statement.
Options missing = ' ';
ods _all_ close;/*To prevent print on screen*/
ods tagsets.ExcelXp
File ='Ex3c.xml'
path="/My path/";
proc print data=ttbl noobs label;
run;
ods tagsets.ExcelXp close;
ods listing;
Option missing=.;/*go back to the default*/
Okay, I found the answer. Need to use options missing=' ' statement.
Options missing = ' ';
ods _all_ close;/*To prevent print on screen*/
ods tagsets.ExcelXp
File ='Ex3c.xml'
path="/My path/";
proc print data=ttbl noobs label;
run;
ods tagsets.ExcelXp close;
ods listing;
Option missing=.;/*go back to the default*/
Since you are using Proc Print you could also use formats for each variable that display space instead of . for missing values, or even "NULL" if desired.
Why are you using PROC PRINT if you don't want a print out?
libname out xlsx "/My path/Ex3b.xlsx";
proc copy inlib=work outlib=out;
select ttbl;
run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.