<?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: Use label to subset my data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110118#M30575</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do the labels of the variables you want to keep (or drop) have any unique characteristics such as a word or phrase(s) that do not occur in the labels of the other variables?&lt;/P&gt;&lt;P&gt;Or do you have an existing list of the labels you want to keep?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Feb 2013 21:52:16 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2013-02-14T21:52:16Z</dc:date>
    <item>
      <title>Use label to subset my data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110117#M30574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a dataset with over thousands of columns and millions of records. I don't need all the columns (need all the rows) and want to subset my dataset by keeping columns that have specific labels. So, the subsetting is not based on column or var names.... it's based on their labels. Any idea how to do it efficiently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 21:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110117#M30574</guid>
      <dc:creator>rezausc</dc:creator>
      <dc:date>2013-02-14T21:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Use label to subset my data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110118#M30575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do the labels of the variables you want to keep (or drop) have any unique characteristics such as a word or phrase(s) that do not occur in the labels of the other variables?&lt;/P&gt;&lt;P&gt;Or do you have an existing list of the labels you want to keep?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 21:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110118#M30575</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-02-14T21:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Use label to subset my data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110119#M30576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create a macro variable with the variable names by querying the dictionary.table with search for the specific label column. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select name into :vlist separated by " "&lt;/P&gt;&lt;P&gt;from dictionary.tables where libname ='SASHELP" and memname="CLASS" and upcase(label) contains "YOUR CRITERIA";&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have (keep= &amp;amp;vlist);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 21:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110119#M30576</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-02-14T21:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Use label to subset my data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110120#M30577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. I'm looking for specific label (contains specific term). But the variables with this label are distributed across all vars. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 22:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110120#M30577</guid>
      <dc:creator>rezausc</dc:creator>
      <dc:date>2013-02-14T22:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Use label to subset my data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110121#M30578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, but I'm a newbie to SAS... Not very familiar with dictionary.tables. When I ran your code, I got ths error:&lt;/P&gt;&lt;P&gt;ERROR: The following columns were not found in the contributing tables: name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, I'm running SAS in command line (no gui).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 22:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110121#M30578</guid>
      <dc:creator>rezausc</dc:creator>
      <dc:date>2013-02-14T22:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Use label to subset my data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110122#M30579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try googling dictionary tables sas and you'll find a lot of references to them. &lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002300185.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a002300185.htm"&gt;SAS(R) 9.2 Language Reference: Concepts, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, I pointed you to the wrong table. It is the sashelp.vcolumn or dictionary.columns table instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can run a proc contents on this table to see the column names and even a proc print to see some of the data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select name into :vlist separated by " "&lt;/P&gt;&lt;P&gt;from dictionary.columns where libname ='SASHELP" and memname="CLASS" and upcase(label) contains "YOUR CRITERIA";&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have (keep= &amp;amp;vlist);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 22:49:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Use-label-to-subset-my-data/m-p/110122#M30579</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-02-14T22:49:57Z</dc:date>
    </item>
  </channel>
</rss>

