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)
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.