<?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 Defining different tables with different variables in same data set in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Defining-different-tables-with-different-variables-in-same-data/m-p/623025#M19874</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see on the example below, I'm trying to create multiple tables on the same dataset however, I want specific variables to be shown in each table. Problem is, the way I'm doing, all tables end up having all the variables I've mentioned in all keep statements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data rule_01 rule_02 rule_03 rule_04;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set have;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if rule_01 = 'fail' then output rule_01; keep reason_1 rule_01;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if rule_02 = 'fail' then output rule_02; keep ID reason_2 rule_02;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if rule_03 = 'fail' then output rule_03; keep reason_3 rule_03;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if rule_04 = 'fail' then output rule_04; keep reason_4 rule_04;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2020 12:27:51 GMT</pubDate>
    <dc:creator>Jrower</dc:creator>
    <dc:date>2020-02-07T12:27:51Z</dc:date>
    <item>
      <title>Defining different tables with different variables in same data set</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Defining-different-tables-with-different-variables-in-same-data/m-p/623025#M19874</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see on the example below, I'm trying to create multiple tables on the same dataset however, I want specific variables to be shown in each table. Problem is, the way I'm doing, all tables end up having all the variables I've mentioned in all keep statements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data rule_01 rule_02 rule_03 rule_04;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set have;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if rule_01 = 'fail' then output rule_01; keep reason_1 rule_01;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if rule_02 = 'fail' then output rule_02; keep ID reason_2 rule_02;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if rule_03 = 'fail' then output rule_03; keep reason_3 rule_03;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if rule_04 = 'fail' then output rule_04; keep reason_4 rule_04;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 12:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Defining-different-tables-with-different-variables-in-same-data/m-p/623025#M19874</guid>
      <dc:creator>Jrower</dc:creator>
      <dc:date>2020-02-07T12:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Defining different tables with different variables in same data set</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Defining-different-tables-with-different-variables-in-same-data/m-p/623029#M19876</link>
      <description>&lt;P&gt;You need to use keep= dataset options on the individual datasets in the DATA statement, like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rule_01 (keep=reason_1 rule_01)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Feb 2020 12:38:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Defining-different-tables-with-different-variables-in-same-data/m-p/623029#M19876</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-07T12:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Defining different tables with different variables in same data set</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Defining-different-tables-with-different-variables-in-same-data/m-p/623033#M19877</link>
      <description>&lt;P&gt;or you can use DROP=&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 12:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Defining-different-tables-with-different-variables-in-same-data/m-p/623033#M19877</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-07T12:52:22Z</dc:date>
    </item>
  </channel>
</rss>

