I’m trying to show a message or another table with empty record if the result is empty after putting an input.
See below codes:
%if (&number ne) %then %do;
Proc print data=Lib.table;
Var “number”n “name”n “age”n;
Where “number”n=“&number”;
Run;
%end;
The input is number This codes for stored process
Solution This is the solution that worked for me.
%if (&number ne) %then %do;
Proc print data=Lib.table;
Var “number”n “name”n “age”n;
Where “number”n=“&number”;
Run;
Proc sql;
Select case
when count()=0 then “No record found”
Else put (count()),11.)
End as Number_of_records
From Lib.table
where 'number'n="&number";
Quit;
%end;