Main Page

From sasCommunity
Jump to: navigation, search

Welcome to sasCommunity.org

A collaborative online community for SAS® users worldwide.

sasCommunity.org is an ongoing global community effort—created by SAS users for SAS users. This site is a place to find answers, share technical knowledge, collaborate on ideas and connect with others in the worldwide SAS Community. Get started now by creating a UserID.

Follow Us
For daily SAS Tips, Web updates & more.

sasCommunity Tip of the Day

In most table lookup tasks, we are doing EXACT matching. However, sometimes we are looking for closest match in the lookup table. By 'closest', we mean smallest Eucleadian distance: ||X-Y||_2. Typically we have to manually code the search function in a DATA STEP, either using ARRAY or using HASH OBJ.

But if we only care about the 1st closest point in lookup table, we can also tweak PROC FASTCLUS for a simple yet fast implementation. Here is an example with 2-dimension data and Euclidean Distance:

data fix;
input x y;
CLUSTER=_n_;
datalines;
1 3
2 4
3 5
8 0.2
15 1
;run;
data have;
input x y;
datalines;
1.2 6
0.3 4
10 1.2
7 1
2.9 4
;run;
%let dsid=%sysfunc(open(fix));
 
%let ntotal=%sysfunc(attrn(&dsid,NOBS));
 
%let dsid=%sysfunc(close(&dsid));
 
proc fastclus data=have out=have2
     seed=fix maxclusters=&ntotal
     noprint maxiter=0 ;
     var x y;
run;

Submitted by Liang Xie. Contact me at my Discussion Page.



Feel free to comment on this tip.


Prior tip - Next tip -- Random Tip

Submit a Tip



Check out the Tip of the Day page for details about this effort.

What's New

Wiki Upgrade
Wiki Upgrade Some of you may have noticed that the appearance of sasCommunity.org has changed slightly. That is because we just upgraded to the latest version of MediaWiki 1.17. The new version is a large release with several technical bug fixes and new features. Read more about the new upgrade. Here are some highlights:
  • Collapsible left navigation categories
  • New customizations in account preferences
  • Additional editing preferences
  • RSS/Atom feeds now available for Watchlists
  • Warning notice if you leave the edit form without saving
  • Search now located in the Header on top


SAS Global Forum 2012
SAS Global Forum 2012

Registration is now open!
Don't miss your opportunity to network with thousands of SAS professionals worldwide and attend hands-on workshops, demonstrations, and more than 300 paper presentations to enhance your SAS skills.

Register for the conference now


Blogs

Recent SAS user blog entries:
 

Content

Recent sasCommunity.org articles:
 

Tips

Recent Tips Submitted by Users:
 

Forums

SAS discussion forum threads:

RSS Feeds for Blogs, Content, Tips and Forums have been temporarily disabled. Please use links above to access information.


Join sasCommunity.org Get Involved Sasopedia Events User Groups
8,488 UserIds have been created on sasCommunity.org!
This number will decrease while userid cleanup is in process.
View the Web-site usage statistics and the definition of terms.


Personal tools
Namespaces
Variants
Actions
Navigate
Sasopedia Detail
Contribute
Connect
Toolbox