<?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: How to create two tables in SAS from one database after sum in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506279#M1284</link>
    <description>1. How do you define "no incidents"? What is the logic?&lt;BR /&gt;2. Have you tried to modify my code to implement the logic from #1.</description>
    <pubDate>Sun, 21 Oct 2018 01:12:34 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-10-21T01:12:34Z</dc:date>
    <item>
      <title>How to create two tables in SAS from one database after sum</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506258#M1280</link>
      <description>&lt;P&gt;How to create two tables in SAS from one database. Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question goes like this: "Create a set that contains all incident variables (non-cumulative cases): ANGINA, HOSPMI, HYPERTEN, MI_FCHD, STROKE. Create a sum that includes incidents. Conditionally output the data to two different SAS tables: one that has subjects with 1 or more incidents and one with subjects with no incidents."&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the principle to summarize the data in order to derive two tables from them: "without incidents" and "1 or more inc."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPD.&amp;nbsp;How to summarize this data horizontally to get the second table "No incidents (0)" ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Снимок.PNG" style="width: 387px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24228i1BC6BCB5D36E523F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Снимок.PNG" alt="Снимок.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 23:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506258#M1280</guid>
      <dc:creator>aether</dc:creator>
      <dc:date>2018-10-20T23:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create two tables in SAS from one database after sum</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506267#M1282</link>
      <description>&lt;P&gt;This depends a lot on your data structure and how you can identify records.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can direct output to two different data sets relatively easily.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data females males other; * list of data sets that will be created;

set sashelp.class; *input data;

*conditionally assign to different output data sets;
if sex = 'F' then output females;
else if sex = 'M' then output males;
else output Other;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/241611"&gt;@aether&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How to create two tables in SAS from one database. Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question goes like this: "Create a set that contains all incident variables (non-cumulative cases): ANGINA, HOSPMI, HYPERTEN, MI_FCHD, STROKE. Create a sum that includes incidents. Conditionally output the data to two different SAS tables: one that has subjects with 1 or more incidents and one with subjects with no incidents."&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the principle to summarize the data in order to derive two tables from them: "without incidents" and "1 or more inc."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 21:05:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506267#M1282</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-20T21:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create two tables in SAS from one database after sum</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506273#M1283</link>
      <description>&lt;P&gt;Please post 2 sets of sample data showing what you have and what you want.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 22:01:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506273#M1283</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-10-20T22:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create two tables in SAS from one database after sum</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506279#M1284</link>
      <description>1. How do you define "no incidents"? What is the logic?&lt;BR /&gt;2. Have you tried to modify my code to implement the logic from #1.</description>
      <pubDate>Sun, 21 Oct 2018 01:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506279#M1284</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-21T01:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create two tables in SAS from one database after sum</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506280#M1285</link>
      <description>1. "No incidents" = 0 in whole line. 2. Yes.</description>
      <pubDate>Sun, 21 Oct 2018 01:17:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506280#M1285</guid>
      <dc:creator>aether</dc:creator>
      <dc:date>2018-10-21T01:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create two tables in SAS from one database after sum</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506281#M1286</link>
      <description>&lt;P&gt;Show your code please.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/241611"&gt;@aether&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;1. "No incidents" = 0 in whole line. 2. Yes.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2018 01:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506281#M1286</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-21T01:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create two tables in SAS from one database after sum</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506282#M1287</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dataset;
      infile '\path\dataset.dat' FIRSTOBS = 2 DSD;
      input /*other variables*/ RANDID ANGINA HOSPMI MI_FCHD STROKE HYPERTEN;
 	  keep RANDID ANGINA HOSPMI MI_FCHD HYPERTEN STROKE;
run;
ods html close;
ods html file = "\path\output.html";

/*here, it seems to me, there should be a horizontal summation by RANDID*/

data NOINC INC;
	set work.dataset;
	if /*sum*/ = 0 then output NOINC;
	else if /*sum*/ = &amp;gt;1 then output INC;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 Oct 2018 01:27:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506282#M1287</guid>
      <dc:creator>aether</dc:creator>
      <dc:date>2018-10-21T01:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create two tables in SAS from one database after sum</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506283#M1288</link>
      <description>sum(&amp;lt;list of variables go here&amp;gt;)&lt;BR /&gt;&lt;BR /&gt;You're pretty close, just add in your list of variables then.</description>
      <pubDate>Sun, 21 Oct 2018 01:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-two-tables-in-SAS-from-one-database-after-sum/m-p/506283#M1288</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-21T01:49:58Z</dc:date>
    </item>
  </channel>
</rss>

