I have a code that creates 3,000 individual excel reports through ODS Tagsets in SAS. Some of them are created even if there is not data in the source dataset. So, when you open the excel report there is no data in it.
I do not want to create the excel report if there is no data in the dataset.
How do I program that?
I tired to copy my table but for some reason I could not do it so I do not have any table to show you.
Thanks in advance.
Most report steps don't make any output when the input data is empty so seeing HOW you are making the report is important.
I don't think the table (if by table you mean the report you are producing) matters that much. The code is more important. And to understand the code it might help to show some sample of the DATASET(s). To show data just post a simple data step that recreates the data. That way the type/length and any formats attached to the variables are clear. Make sure to use the Insert SAS Code button to get a pop-up window to paste/type/edit your code so that formatting is preserved.
Tom, thanks for your reply. I was able to resolve it by doing below.
proc sql noprint;
select count(*) into :nobs
from test
where custrun = "&custrun.";
quit;
%if &nobs = 0 %then %do;
%goto exitgoto;
%end;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.