<?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 trying to do calculations off of a built table in SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591534#M76003</link>
    <description>&lt;P&gt;I have a table built with integer values (Table X)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column 1&amp;nbsp; Column 2&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;BR /&gt;&lt;BR /&gt;I have a secondary table (Table Y) built with Decimal variables to contain a calculated number based on Table X&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;/P&gt;&lt;P&gt;(select sum(Column 2) from Table X where&amp;nbsp; Column 1 like ('A', 'B') ) /&lt;/P&gt;&lt;P&gt;(select Column 2 from Table X where Column 1 = 'C');&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run this calculation but am getting an error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, EXCEPT, INTERSECT, ORDER, OUTER, UNION.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Sep 2019 14:08:49 GMT</pubDate>
    <dc:creator>Jyuen204</dc:creator>
    <dc:date>2019-09-25T14:08:49Z</dc:date>
    <item>
      <title>trying to do calculations off of a built table in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591534#M76003</link>
      <description>&lt;P&gt;I have a table built with integer values (Table X)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column 1&amp;nbsp; Column 2&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;BR /&gt;&lt;BR /&gt;I have a secondary table (Table Y) built with Decimal variables to contain a calculated number based on Table X&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;/P&gt;&lt;P&gt;(select sum(Column 2) from Table X where&amp;nbsp; Column 1 like ('A', 'B') ) /&lt;/P&gt;&lt;P&gt;(select Column 2 from Table X where Column 1 = 'C');&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run this calculation but am getting an error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, EXCEPT, INTERSECT, ORDER, OUTER, UNION.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 14:08:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591534#M76003</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2019-09-25T14:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: trying to do calculations off of a built table in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591540#M76004</link>
      <description>&lt;P&gt;Although you mention you have table Y, it doesn't seem to appear in your description of the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where does it come into use?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 14:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591540#M76004</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-25T14:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: trying to do calculations off of a built table in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591541#M76005</link>
      <description>&lt;P&gt;I am going to be insterting the caluclated value into Table Y. I suppose it's not relevant here because my issue is the calculation part.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 14:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591541#M76005</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2019-09-25T14:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: trying to do calculations off of a built table in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591545#M76006</link>
      <description>&lt;P&gt;Show us the log of this PROC SQL step. We need to see the entire LOG, not just the error message. To preserve the formatting and make the log readable, please click on the {i} icon and paste the log into the window that appears —&amp;nbsp;&lt;STRONG&gt;do not skip this step&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 14:20:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591545#M76006</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-25T14:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: trying to do calculations off of a built table in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591587#M76009</link>
      <description>&lt;P&gt;Proper syntax could be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table Y as
	sum((column1 like ('A', 'B'))*Column2) / 
	sum((column1 = 'C')*Column2) as Ratio
from X;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Sep 2019 15:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591587#M76009</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-09-25T15:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: trying to do calculations off of a built table in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591596#M76012</link>
      <description>&lt;P&gt;Or try the third step of this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data X;
input Column1 $ Column2;
cards;
A 1
B 2
C 10
;

proc sql;
create table Y (z num);
quit;

proc sql;
insert into Y
select
(select sum(Column2) from X where Column1 in ('A', 'B')) / Column2
from X where Column1 = 'C';
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Sep 2019 15:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/trying-to-do-calculations-off-of-a-built-table-in-SAS/m-p/591596#M76012</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-09-25T15:50:53Z</dc:date>
    </item>
  </channel>
</rss>

