Heya people, I am generating three html pages using a macro script (as below).
What happened is that when "Orange" was selected, there wasn't any "Orange" sold last week, therefore Data ABC has 0 Obs and causes "ORANGE.HTML" to be produced as a blank page. This is totally understandable.
So I thought maybe I can do something more informative for the users whereby, if any of the htmls (not just orange.html, could be apple.html next week vice versa) is produced as blank due to 0 OBS, I can redirect that blank page to "Error.Html" instead saying something like "Sorry no oranges were sold this week"?
However, not sure how to do this.... 😞 Hoping someone can help me out with this one! Thanks in advance!
%Macro Fruits (HTML=, Fruits=)
ODS HTML Body = &HTML.;
Data ABC;
Set DEF;
Where Fruits = '&Fruits.';
Run;
PROC SORT
DATA=ABC;
BY Fruits;
RUN;
ODS HTML Close;
%Mend Fruits;
%Fruits (HTML= "Apple.Html", Fruits = Apple)
%Fruits (HTML= "Orange.Html", Fruits = Orange)
%Fruits (HTML= "Strawberry.Html", Fruits = Strawberry)
... View more