display a text for missing values for date column in ods excel

Accepted Solution Solved
Reply
Contributor
Posts: 27
Accepted Solution

display a text for missing values for date column in ods excel

Hi All,

 

I am exporting a data into excel using ODS tagsets.ExcelXP and I wanted to display missing values of Date column as '<missing>'. Can it be possible to display each missing value of only date column as said before? If yes then could please help me.

 

I am working on SAS 9.2 version.

 

Many thanks in advance.

 

Regards,

Vikrant

 


Accepted Solutions
Solution
‎07-11-2016 02:47 AM
Grand Advisor
Posts: 10,223

Re: display a text for missing values for date column in ods excel

If your variable(s) is an actual SAS date value you likely want to modify @Ksharp's solution to use reference the preferred date format for the non-missing values:

 

Proc Format;

value Mydate

.= '<missing>'

other= [mmddyy10.]

;

run;

View solution in original post


All Replies
Grand Advisor
Posts: 9,584

Re: display a text for missing values for date column in ods excel


You need to make a format .




proc format;
value fmt
 .= '';
run;

data class;
 set sashelp.class;
 if _n_ in (1 4) then call missing(age);
 format age fmt.;
run;


ODS tagsets.ExcelXP file='/folders/myfolders/x.xml';
proc print data=class noobs;run;
ods tagsets.ExcelXP close;




Solution
‎07-11-2016 02:47 AM
Grand Advisor
Posts: 10,223

Re: display a text for missing values for date column in ods excel

If your variable(s) is an actual SAS date value you likely want to modify @Ksharp's solution to use reference the preferred date format for the non-missing values:

 

Proc Format;

value Mydate

.= '<missing>'

other= [mmddyy10.]

;

run;

Contributor
Posts: 27

Re: display a text for missing values for date column in ods excel

Thank you very much...
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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