BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ronein
Meteorite | Level 14

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;
1 ACCEPTED SOLUTION

Accepted Solutions
Ronein
Meteorite | Level 14

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*/

 

 

View solution in original post

3 REPLIES 3
Ronein
Meteorite | Level 14

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*/

 

 

ballardw
Super User

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.

Tom
Super User Tom
Super User

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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 545 views
  • 0 likes
  • 3 in conversation