<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: drop list of variables from macro variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184803#M46984</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you are going for a "best practice", I would use the approach suggested by &lt;A __default_attr="814511" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following uses that approach, combined with your latest code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data to_drop;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat _name_ $32.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input _name_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;_type_&lt;/P&gt;&lt;P&gt;name&lt;/P&gt;&lt;P&gt;age&lt;/P&gt;&lt;P&gt;height&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table to_drop2 as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct a._name_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from to_drop as a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join dictionary.columns as b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on upcase(a._name_) = upcase(b.name)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where b.libname='SASHELP' and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.memname = 'CLASS'&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set to_drop2 end=last;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_=1 then call execute('data want; set sashelp.class (drop=');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute(' '||strip(_name_));&lt;/P&gt;&lt;P&gt;&amp;nbsp; if last then call execute('); run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Jan 2015 18:35:16 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2015-01-15T18:35:16Z</dc:date>
    <item>
      <title>drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184793#M46974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wanted to drop a list of variables from my inputds. This list itself is present as observations in another dataset. After doing some googling, I found this excellent paper on the topic.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi30/028-30.pdf" title="http://www2.sas.com/proceedings/sugi30/028-30.pdf"&gt;http://www2.sas.com/proceedings/sugi30/028-30.pdf&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i used the following code to make a list in a macro variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*make a list of variables as a macro variable */&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;length allvars $1000;&lt;/P&gt;&lt;P&gt;retain allvars ' ';&lt;/P&gt;&lt;P&gt;set to_drop end=eof;&lt;/P&gt;&lt;P&gt;allvars = trim(left(allvars))||' '||left(_name_);&lt;/P&gt;&lt;P&gt;if eof then call symput('varlist', allvars);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing three problems now:&lt;/P&gt;&lt;P&gt;1) When I %PUT &amp;amp;VARLIST , the log displays only 31 of the variables whereas my list is actually 2000+ variables.&lt;/P&gt;&lt;P&gt;2) I don't clearly understand what the statement: trim(left(allvars)) || ' ' || left(_name_); is doing. I know trim removes leading spaces and left is to align left character strings but cannot understand the full statement.&lt;/P&gt;&lt;P&gt;3) Then I try to drop it from my inputds using the following code, I get a warning message and the drop doesn't happen:&lt;/P&gt;&lt;P&gt;data inputds2 (drop = &amp;amp;varlist);&lt;/P&gt;&lt;P&gt;set inputds;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WARNING: The variable &lt;STRONG&gt;avg_weighted&lt;/STRONG&gt; in the DROP, KEEP, or RENAME list has never been referenced.&lt;/P&gt;&lt;P&gt;NOTE: There were 43662 observations read from the data set WORK.INPUTDS.&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.INPUTDS2 has 43662 observations and 3465 variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In reality my variable name reads like : avg_weighted_minutes_view_3739 avg_weighted_minutes_view_7963 avg_weighted_minutes_view_(XXXX) The last 4 digits are random. The are SAS generated names since my labels contain spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT: Tried using another code which is working partially - it makes a bigger list- around 1000 of the 2000+ variables in the &amp;amp;VARLIST macro variable. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set to_drop;&lt;/P&gt;&lt;P&gt;call symput('varlist',trim(&lt;/P&gt;&lt;P&gt;resolve('&amp;amp;varlist')&lt;/P&gt;&lt;P&gt;)||' '||trim(_name_));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;varlist;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Total beginner at SAS .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;nikhil&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Nikhil Goyal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 15:57:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184793#M46974</guid>
      <dc:creator>ngnikhilgoyal</dc:creator>
      <dc:date>2015-01-15T15:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184794#M46975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nikhil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problems you are noticing come about because $1000 is not long enough to hold 2000 variable names.&amp;nbsp; While you could increase it, there are easier ways to get the full set of 2000 names into a macro variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select strip(_name_) into : varlist separated by ' ' from to_drop;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, move the DROP to the SET statement to speed up processing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data inputds2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set inputds (drop=&amp;amp;varlist);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 16:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184794#M46975</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-01-15T16:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184795#M46976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to be a growing number of these type of questions regarding using macro variables to hold large lists of items.&amp;nbsp; IMO its really not a good idea.&amp;nbsp; There are limits on the lengths of the them to start with, and the spaghetti %&amp;amp;&amp;amp;&amp;amp;&amp;amp;%&amp;amp; nonsense needed to handle them just gets out of hand.&amp;nbsp; I would recommend you look at the metadata for your dataset and work from there:&lt;/P&gt;&lt;P&gt;/* I assue your dataset with variables to drop is have and is in work, and you have a dataset called drop_list which has one column called name */&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set drop_list end=last;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_=1 then call execute('data have; set have (drop='||strip(name));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else call execute(' '||strip(name));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if last then call execute('); run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will create a dataset code which will have a drop statement for each row in drop_list.&lt;/P&gt;&lt;P&gt;Furthermore, SAS itself keeps plenty of metadata on the datasets in SASHELP.VCOLUMN/VTABLE.&amp;nbsp; From there you can query columns, types, obs etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 16:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184795#M46976</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-01-15T16:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184796#M46977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Astounding,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The proc sql creates the list very fast. However when I drop the &amp;amp;varlist, I get an error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;: The variable _TYPE_ in the DROP, KEEP, or RENAME list has never been referenced.&lt;/P&gt;&lt;P&gt;289&lt;/P&gt;&lt;P&gt;290&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set WORK.INPUTDS2 may be incomplete.&amp;nbsp; When this step was stopped there were 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; observations and 0 variables.&lt;/P&gt;&lt;P&gt;WARNING: Data set WORK.INPUTDS2 was not replaced because this step was stopped.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.87 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is an observation called _TYPE_ in the to_drop list. I think that is causing the problem. Also I tried to increase the legth of allvars but i think there are limits - the 2000 variables have a length which exceeds the limit hence my &amp;amp;varlist is getting truncated !&amp;nbsp; &lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;length allvars $100000;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 16:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184796#M46977</guid>
      <dc:creator>ngnikhilgoyal</dc:creator>
      <dc:date>2015-01-15T16:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184797#M46978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Repeatedly getting error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;155-205: Line generated by the CALL EXECUTE routine.&lt;/P&gt;&lt;P&gt;2076 +&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23&lt;/P&gt;&lt;P&gt;ERROR 23-7: Invalid value for the DROP option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set WORK.have may be incomplete.&amp;nbsp; When this step was stopped there were 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; observations and 0 variables.&lt;/P&gt;&lt;P&gt;WARNING: Data set WORK.have was not replaced because this step was stopped.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.66 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.29 seconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 16:50:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184797#M46978</guid>
      <dc:creator>ngnikhilgoyal</dc:creator>
      <dc:date>2015-01-15T16:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184798#M46979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you have a variable in the to_drop dataset not in the data set you want to modify. I would guess that you have some sort of summary data set generated by a procedure that adds _type_ to identify the combination of variables represented by the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select strip(_name_) into : varlist separated by ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from to_drop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where _name_ ne '_TYPE_';&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 16:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184798#M46979</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-01-15T16:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184799#M46980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with ballardw's diagnosis.&amp;nbsp; It might be safer to try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where upcase(_name_) ne '_TYPE_'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also note, SAS places a limit on the length of character variables.&amp;nbsp; 100,000 exceeds that ... I believe the limit is roughly 64,000.&amp;nbsp; Macro variables have a similar size restriction as well.&amp;nbsp; So if you had 5,000 variable names to drop, even a single macro variable might not be able to hold them all.&lt;/P&gt;&lt;P&gt;Looks like you're most of the way there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 17:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184799#M46980</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-01-15T17:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184800#M46981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are spot on ! that worked and fixed it . I am thinking the best practice is to first create a new to_drop2 (matched list) from to_drop and inputds containing only common varnames. something along the line of :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; to_drop2 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a._name_&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; to_drop &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;inner&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; dictionary.columns &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; b&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a._name_ = b.name&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; b.memname = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'INPUTDS'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;but it's returning a 0 obs dataset . . . if it works then I wont have to bother with the manual entering the "where _name_ . . . . "&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 17:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184800#M46981</guid>
      <dc:creator>ngnikhilgoyal</dc:creator>
      <dc:date>2015-01-15T17:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184801#M46982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Memname is always stored in upper case, so if you used:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; b.memname = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'INPUTDS';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;&lt;SPAN style="color: #000000; font-family: arial,helvetica,sans-serif;"&gt;it should work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 17:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184801#M46982</guid>
      <dc:creator>KevinL70</dc:creator>
      <dc:date>2015-01-15T17:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184802#M46983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Character values in SAS are case-sensitive, so when joining two datasets, you have to remember that and consider how that might affect your join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Note that many character values in the DICTIONARY tables are stored as all-uppercase characters; you should design your queries accordingly." That is from &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002300185.htm"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002300185.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would suggest that you use the UpCase function as below:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; UpCase(a._name_) = b.name&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 17:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184802#M46983</guid>
      <dc:creator>smiller933</dc:creator>
      <dc:date>2015-01-15T17:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: drop list of variables from macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184803#M46984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you are going for a "best practice", I would use the approach suggested by &lt;A __default_attr="814511" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following uses that approach, combined with your latest code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data to_drop;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat _name_ $32.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input _name_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;_type_&lt;/P&gt;&lt;P&gt;name&lt;/P&gt;&lt;P&gt;age&lt;/P&gt;&lt;P&gt;height&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table to_drop2 as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct a._name_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from to_drop as a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join dictionary.columns as b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on upcase(a._name_) = upcase(b.name)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where b.libname='SASHELP' and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.memname = 'CLASS'&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set to_drop2 end=last;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_=1 then call execute('data want; set sashelp.class (drop=');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call execute(' '||strip(_name_));&lt;/P&gt;&lt;P&gt;&amp;nbsp; if last then call execute('); run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 18:35:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/drop-list-of-variables-from-macro-variable/m-p/184803#M46984</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-01-15T18:35:16Z</dc:date>
    </item>
  </channel>
</rss>

