<?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: Can't subset a dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851556#M37383</link>
    <description>&lt;P&gt;Probably, it would help to see the log, as said by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt; . And we need to see the &lt;STRONG&gt;ENTIRE&lt;/STRONG&gt; log for you DATA step, not portions, not the errors only, &lt;STRONG&gt;ALL OF IT&lt;/STRONG&gt; for this DATA step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;My data looks something like this:&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you can help yourself &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/371959"&gt;@Kelly_K&lt;/a&gt; get faster and better answers, and help us help you, by providing us your exact data (or a portion of it), rather than "... something like this". You need to provide (a portion of) your data as &lt;STRONG&gt;working&lt;/STRONG&gt; SAS data step code, emphasis on &lt;STRONG&gt;working&lt;/STRONG&gt;, which you can type in yourself or follow &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt;. This should be standard operating procedure, in this thread, and from now on whenever you post a question here.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Dec 2022 21:46:35 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-12-29T21:46:35Z</dc:date>
    <item>
      <title>Can't subset a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851436#M37358</link>
      <description>&lt;P&gt;Hi, SAS Community.&lt;/P&gt;&lt;P&gt;I'm trying to subset a dataset so that it includes only those observations that have the variable "year" coded as 2008, but either nothing happens or my output data table is devoid of observations for all variables. &amp;nbsp;&lt;/P&gt;&lt;P&gt;My data looks something like this:&lt;/P&gt;&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp;var1 &amp;nbsp; &amp;nbsp; &amp;nbsp; var2 &amp;nbsp; &amp;nbsp; var3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;year&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 25 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;38 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2008&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;72 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2016&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 51 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; no &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2008&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;16 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2016&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following code creates a dataset with all variable columns but no values:&lt;/P&gt;&lt;P&gt;data subset;&lt;BR /&gt;set dataset;&lt;BR /&gt;where year=2008;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following code creates a dataset with no observations deleted (i.e., dataset = subset):&lt;/P&gt;&lt;DIV&gt;data subset;&lt;/DIV&gt;&lt;DIV&gt;set dataset;&lt;/DIV&gt;&lt;DIV&gt;if year=2016 then delete;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I've even tried convoluted code, like the one below, but it also results in an empty data table (i.e., no values in any of the columns):&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc sort data=dataset(where=(year=2008)) out=subset;&lt;BR /&gt;by id;&lt;BR /&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Does anyone know what's going on? &amp;nbsp;Google is definitely not being my friend in this instance.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks.&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Dec 2022 23:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851436#M37358</guid>
      <dc:creator>Kelly_K</dc:creator>
      <dc:date>2022-12-28T23:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can't subset a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851554#M37381</link>
      <description>&lt;P&gt;Give us the LOG !&lt;/P&gt;
&lt;P&gt;Probably year is a character variable (or something else that should be obvious from the LOG).&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 21:22:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851554#M37381</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-12-29T21:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can't subset a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851556#M37383</link>
      <description>&lt;P&gt;Probably, it would help to see the log, as said by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt; . And we need to see the &lt;STRONG&gt;ENTIRE&lt;/STRONG&gt; log for you DATA step, not portions, not the errors only, &lt;STRONG&gt;ALL OF IT&lt;/STRONG&gt; for this DATA step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;My data looks something like this:&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you can help yourself &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/371959"&gt;@Kelly_K&lt;/a&gt; get faster and better answers, and help us help you, by providing us your exact data (or a portion of it), rather than "... something like this". You need to provide (a portion of) your data as &lt;STRONG&gt;working&lt;/STRONG&gt; SAS data step code, emphasis on &lt;STRONG&gt;working&lt;/STRONG&gt;, which you can type in yourself or follow &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt;. This should be standard operating procedure, in this thread, and from now on whenever you post a question here.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 21:46:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851556#M37383</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-29T21:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can't subset a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851557#M37384</link>
      <description>&lt;P&gt;Data is proprietary and I don't feel comfortable sharing it, which is why I posed the question the way I did. &amp;nbsp;In any event, the problem has been solved. &amp;nbsp;I thought I had indicated that. &amp;nbsp;Thanks. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 21:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851557#M37384</guid>
      <dc:creator>Kelly_K</dc:creator>
      <dc:date>2022-12-29T21:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can't subset a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851558#M37385</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/371959"&gt;@Kelly_K&lt;/a&gt;&amp;nbsp;Then please post fake data with fake variable names which has the exact same data set structure as the real data. Post it as &lt;STRONG&gt;WORKING&lt;/STRONG&gt; data step code. We will consistently ask you to provide data in that format, so please just go ahead and provide data in that format from now on. You will be helping us, which helps you.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 22:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851558#M37385</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-29T22:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can't subset a dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851560#M37386</link>
      <description>Yes.  It doesn't matter now but I would have wagered on &lt;BR /&gt;where year='2008';</description>
      <pubDate>Thu, 29 Dec 2022 22:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-t-subset-a-dataset/m-p/851560#M37386</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2022-12-29T22:20:02Z</dc:date>
    </item>
  </channel>
</rss>

