As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


User:LainieH/sandbox10/main1

From sasCommunity
Jump to: navigation, search

MOCKUP ONLY. TESTING IDEAS FOR POTENTIAL HOME PAGE RESIGN.

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


As part of the decommissioning effort for sasCommunity.org this article/tip has been migrated to communities.sas.com.

The new home for this article/tip is LainieH/sandbox10/main1 (https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Check-if-a-variable-exists-in-a-dataset/m-p/475813#M175)



Have you ever needed to know if a given variable is in a SAS data set? This macro returns 1 if a variable exists in a data set, and 0 if not.

%macro VarExist(ds, var);
    %local rc dsid result;
    %let dsid = %sysfunc(open(&ds));
 
    %if %sysfunc(varnum(&dsid, &var)) > 0 %then %do;
        %let result = 1;
        %put NOTE: Var &var exists in &ds;
    %end;
    %else %do;
        %let result = 0;
        %put NOTE: Var &var not exists in &ds;
    %end;
 
    %let rc = %sysfunc(close(&dsid));
    &result
%mend VarExist;
 
/* Usage */
%put %VarExist(sashelp.class, name);
%put %VarExist(sashelp.class, aaa);

Submitted by Adrien VALLEE. 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

Blogs

Recent SAS user blog entries:

...View all on sasCommunity.org Planet
 

Content

Recent sasCommunity.org articles:
...View all new articles
...Add your knowledge to sasCommunity.org
 

Tips

Review Recent Tips Submitted by Users:

...Browse all sasCommunity.org Tips of the Day
...Submit a Tip
 

Forums

Top SAS user threads on support.sas.com:

...View all discussions

Featured Articles

 
Browse the New Sasopedia
The Sasopedia is a growing online knowledge base
of user-contributed SAS content, code & tips
Browse The Newly Organized Sasopedia:

Now you can see the number of articles next to each category and click the (+) symbol to peruse the article list from a single page. We hope these updates make it easier to use and navigate. Please add feedback to the discussion tab on the Sasopedia page.

Special thanks to sasCommunity.org member Murphy Choy who volunteered in categorizing articles, resulting in a much larger database for you to search and browse.

Your contributions are important. Here are some helpful tips on how to contribute to the Sasopedia and other areas of the site.

Plus:

 
Michael says Thank You
Michael A. Raithel delivers the lunchtime keynote presentation at SAS Global Forum 2010


A Personal Message From Michael A. Raithel:

I would like to thank each and every one of the 628 SAS professionals who attended my lunchtime keynote presentation, It’s Not Easy Being A SAS Programmer, at SAS Global Forum 2010, but I didn’t catch all of their names. :) It was a great group and we had fun as we shared some of the trials and tribulations of being a SAS programmer. Of course, being savvy SAS professionals, I would bet that they are all regular visitors to sasCommunity.org. So, it seems fitting for me to tell them the following right here:

Thank you very much for attending my lunchtime keynote speech! Best of luck in all your SAS endeavors!

Stay tuned to sasCommunity.org to keep up with news about SAS Global Forum 2011!

Click to enlarge image
Click to enlarge image



9,514 UserIds have been created on sasCommunity.org!
View the Web-site usage statistics and the definition of terms.


Join sasCommunity.org Get Involved Sasopedia Events User Groups