<?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: Put all variable names into macro in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129397#M35277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you use the ^ character in your where statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Nov 2013 15:44:14 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2013-11-02T15:44:14Z</dc:date>
    <item>
      <title>Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129388#M35268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a macro, which is used to drop all variables with suffix "_dup". Now the problem is, how to put all variable names into this macro, since I have over 400 variables in this data set? Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 19:24:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129388#M35268</guid>
      <dc:creator>PeterPanPan</dc:creator>
      <dc:date>2013-10-30T19:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129389#M35269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would have named the variables dup_XXXXX and then used&lt;/P&gt;&lt;P&gt;drop dup_: ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But otherwise:&lt;/P&gt;&lt;P&gt;I have changed a piece of my code ..... to get the variable names in a dataset and the create another dataset changed accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New';"&gt;* need to get a list of all variables and generate this code accordingly ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;contents&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;data&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;=DataSetName &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;out&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;=DatasetContents;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New';"&gt;* No SAS data set is created ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;&amp;nbsp; DatasetContents &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;=lastobs; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;file&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;'W:\SAS_Temp\AutoCode1.txt'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New';"&gt;* Output Text File ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; _n_ =&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&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; &lt;SPAN style="background: white; color: green; font-family: 'Courier New';"&gt;* for the start of the code ... ;&lt;/SPAN&gt;&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; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;put&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;'data NewDataSetName ; '&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&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; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;put&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set DataSetName; '&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&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; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;put&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop '&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: green; font-family: 'Courier New';"&gt;* check if the name contains _dup ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;if &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;index(upcase(name),&lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;"_DUP"&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;)&amp;gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;put&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;' &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; name &lt;/SPAN&gt;&lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;' &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; lastobs &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&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; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;put&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; '&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; ; &lt;/SPAN&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New';"&gt;* last variable ;&lt;/SPAN&gt;&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; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;put&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;'run ; '&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; &lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New';"&gt;* run the code we just wrote ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;%include&lt;/SPAN&gt; &lt;SPAN style="background: white; color: purple; font-family: 'Courier New';"&gt;'W:\SAS_Temp\AutoCode1.txt'&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 19:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129389#M35269</guid>
      <dc:creator>MumSquared</dc:creator>
      <dc:date>2013-10-30T19:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129390#M35270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can hit the dictionary or SASHELP tables that list the metadata for each table. &lt;/P&gt;&lt;P&gt;The comparisons are case sensitive, and you may want to browse through SASHELP.VColumns so you understand what it's doing.&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select memname into :var_list separated by " "&lt;/P&gt;&lt;P&gt;from sashelp.vcolumn where libname="WORK" and memname="MY_TABLE" and upcase(name) like %_DUP" ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 20:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129390#M35270</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-10-30T20:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129391#M35271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're missing a double-quote there, Reeza, the sql command should end with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... and memname="MY_TABLE" and upcase(name) like "%_DUP" ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 20:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129391#M35271</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-10-30T20:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129392#M35272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it should &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select memname into :var_list separated by " "&lt;/P&gt;&lt;P&gt;from sashelp.vcolumn where libname="WORK" and memname="MY_TABLE" and upcase(name) like "%_DUP" ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 20:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129392#M35272</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-10-30T20:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129393#M35273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza,can you please explain why select memname and not select name ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 03:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129393#M35273</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2013-11-01T03:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129394#M35274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe it was a typo. It should be 'name'. In this case, 'memname' addresses name of the table, while 'name' contains the names of variables (columns).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 12:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129394#M35274</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-11-01T12:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129395#M35275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll say it wasn't a typo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname="WORK" finds all datasets in the proper directory in the dictionary table&lt;/P&gt;&lt;P&gt;memname="MY_TABLE" refers to the proper SAS data set in the dictionary table&lt;/P&gt;&lt;P&gt;upcase(name) like "%_DUP" refers to the column names in WORK.MY_TABLE and finds those that end with _DUP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 13:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129395#M35275</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-11-01T13:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129396#M35276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two ways to get the list of variables in a dataset.&amp;nbsp; Use PROC CONTENTS and output to dataset. Or query the SAS metadata DICTIONARY.COLUMNS (also available as the view SASHELP.VCOLUMN).&amp;nbsp; Once you pick one of those for the source of the variable list then the easiest way to generate a DROP statement like that is to put the variable names into a macro variable using PROC SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc sql noprint ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let droplist=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;select name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; into :droplist separated by ' '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;from dictionary.columns&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;where libname='MYLIB'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; and memname='MYDS'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; and upcase(name) like '%^_DUP' escape '^'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your macro is copying the data then you can use this list in DROP statement or DROP= dataset option. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set mylib.myds (drop=&amp;amp;droplist) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 13:04:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129396#M35276</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-11-01T13:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129397#M35277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you use the ^ character in your where statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Nov 2013 15:44:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129397#M35277</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-11-02T15:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Put all variable names into macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129398#M35278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The LIKE operator uses underscore to match any single character.&amp;nbsp; So like '%_DUP' would match 'A_DUP' and 'ABDUP'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By escaping it you can search for the underscore character itself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Nov 2013 15:49:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Put-all-variable-names-into-macro/m-p/129398#M35278</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-11-02T15:49:30Z</dc:date>
    </item>
  </channel>
</rss>

