Assuming that your check will be against the observation count in a data set, here is a little macro that i use to return the number of observations in a data set.
%macro obscnt(dsn);
%local nobs dsnid rc;
%let nobs=.;
%* Open the data set of interest;
%let dsnid = %sysfunc(open(&dsn));
%* If the open was successful get the;
%* number of observations and CLOSE &dsn;
%if &dsnid %then %do;
%let nobs=%sysfunc(attrn(&dsnid,nlobs));
%let rc =%sysfunc(close(&dsnid));
%end;
%else %do;
%put WARNING: Unable to open &dsn;
%put %sysfunc(sysmsg());
%end;
%* Return the number of observations;
&nobs
%mend obscnt;
in your program you might use it something like:
%if %obscnt(mydata)>25 %then %do;