<?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 Subsetting a dataset output from Proc Tabulate in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Subsetting-a-dataset-output-from-Proc-Tabulate/m-p/124415#M34189</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a dataset that contains electricity output from a variety of different types of fuels, and I'm grouping them into renewable and non-renewable energy by using a format in PROC TABULATE. I also output the table to a SAS dataset (I've tried this using both the OUT option and ODS). I would like to be able to then subset the table using a data step so I keep only the non-renewable energy and perform a calculation using one of the pieces of data in the output dataset. However, when I try to use a WHERE statement with the name I used for the format "non-renewable," SAS doesn't find any records. Apparently the Tabulate procedure outputs the data using the original source names then applies the format to the output dataset. So when I was looking at it in the results, I could see the records marked non-renewable, but the underlying data still reflects the original source names. That's why I can't find any records under non-renewable, because there is no "non-renewable" source name in the dataset. So that's kind of a long-winded way of asking if there's a way to output the data in such a way that the outputted fields reflect the format labels and not the original data. Thanks in advance for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Feb 2013 21:40:47 GMT</pubDate>
    <dc:creator>ebowen</dc:creator>
    <dc:date>2013-02-28T21:40:47Z</dc:date>
    <item>
      <title>Subsetting a dataset output from Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Subsetting-a-dataset-output-from-Proc-Tabulate/m-p/124415#M34189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a dataset that contains electricity output from a variety of different types of fuels, and I'm grouping them into renewable and non-renewable energy by using a format in PROC TABULATE. I also output the table to a SAS dataset (I've tried this using both the OUT option and ODS). I would like to be able to then subset the table using a data step so I keep only the non-renewable energy and perform a calculation using one of the pieces of data in the output dataset. However, when I try to use a WHERE statement with the name I used for the format "non-renewable," SAS doesn't find any records. Apparently the Tabulate procedure outputs the data using the original source names then applies the format to the output dataset. So when I was looking at it in the results, I could see the records marked non-renewable, but the underlying data still reflects the original source names. That's why I can't find any records under non-renewable, because there is no "non-renewable" source name in the dataset. So that's kind of a long-winded way of asking if there's a way to output the data in such a way that the outputted fields reflect the format labels and not the original data. Thanks in advance for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 21:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Subsetting-a-dataset-output-from-Proc-Tabulate/m-p/124415#M34189</guid>
      <dc:creator>ebowen</dc:creator>
      <dc:date>2013-02-28T21:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting a dataset output from Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Subsetting-a-dataset-output-from-Proc-Tabulate/m-p/124416#M34190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data set itself will always contain the unformatted values.&amp;nbsp; Given your description of what you are trying to accomplish, the easiest way to subset might be to subset the output as part of PROC TABULATE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... out=my_output_dataset (where=(put(variable, fmtname.)='non-renewable'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will still have to figure out what values are in the data set, but at least you'll be working with the proper subset.&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, 28 Feb 2013 22:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Subsetting-a-dataset-output-from-Proc-Tabulate/m-p/124416#M34190</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-02-28T22:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting a dataset output from Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Subsetting-a-dataset-output-from-Proc-Tabulate/m-p/124417#M34191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer. I think I may just add another variable to the dataset using a data step and an if statement that includes all of the energy sources that I want in renewable/non-renewable. Then I can use PROC TABULATE to group them by the new variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 15:14:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Subsetting-a-dataset-output-from-Proc-Tabulate/m-p/124417#M34191</guid>
      <dc:creator>ebowen</dc:creator>
      <dc:date>2013-03-01T15:14:46Z</dc:date>
    </item>
  </channel>
</rss>

