I am trying to provide stopping criteria for clustering if K(no of cluster) is less than number of rows.
I have tried using PROC IML, but not getting proper output.
data abc1;
input A;
datalines;
20
;
%MACRO ABC(Data);
proc fastclus data=&Data maxc=2 out=corrCluster noprint;
run;
%MEND ABC;
proc iml;
use abc1;
read all into X1;
if(nrow(X1)>=2) then
do;
%ABC(abc1);
end;
quit;Can you plz tell how to fix above...
Or is there another way to do this?
Make a macro for it .
%MACRO ABC(Data);
%let dsid=%sysfunc(open( &data ));
%let nobs=%sysfunc(attrn(&dsid, nlobs ));
%let dsid=%sysfunc(close(&dsid));
%if &nobs > 2 %then %do;
proc fastclus data=&Data maxc=2 out=corrCluster noprint;
run;
%end;
%MEND ABC;
%ABC(abc1)
Make a macro for it .
%MACRO ABC(Data);
%let dsid=%sysfunc(open( &data ));
%let nobs=%sysfunc(attrn(&dsid, nlobs ));
%let dsid=%sysfunc(close(&dsid));
%if &nobs > 2 %then %do;
proc fastclus data=&Data maxc=2 out=corrCluster noprint;
run;
%end;
%MEND ABC;
%ABC(abc1)
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.