<?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: IF/Then Statement tying multiple rows together in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/IF-Then-Statement-tying-multiple-rows-together/m-p/186849#M1151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, let me try to be more specific. in a different question.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Jul 2014 22:20:26 GMT</pubDate>
    <dc:creator>Tglass55</dc:creator>
    <dc:date>2014-07-27T22:20:26Z</dc:date>
    <item>
      <title>IF/Then Statement tying multiple rows together</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/IF-Then-Statement-tying-multiple-rows-together/m-p/186847#M1149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the basic idea:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;1&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;2&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;3&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Goal&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Person 1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Household 1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Wages - 10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Household 1 Wages - 20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Person 2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Household 2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Wages - 10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Household 2 Wages - 10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Person 3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Household 1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Wages - 10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Household 1 Wages - 20&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to write an If/then statement that would search throughout all of column 2 to find similar household #'s and then find the sum and put them in the "goal column."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would appreciate your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 00:49:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/IF-Then-Statement-tying-multiple-rows-together/m-p/186847#M1149</guid>
      <dc:creator>Tglass55</dc:creator>
      <dc:date>2014-07-21T00:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: IF/Then Statement tying multiple rows together</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/IF-Then-Statement-tying-multiple-rows-together/m-p/186848#M1150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data you show us are all strings but you want to use the digits of column '3' as numeric values and sum them up. Not sure if your real data looks as posted or if this is already formatted data.&lt;/P&gt;&lt;P&gt;It would help in the future if you could post a proper SAS data step which creates sample data together with a description of how the expected result should look like. This way you're taking out the guess-work for us and you also have a better chance to get an answer which fits your actual data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below some code which deals with the data as posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile datalines truncover dlm=',' dsd;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input (person household wages) (:$20.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;Person 1,Household 1,Wages - 10&lt;/P&gt;&lt;P&gt;Person 2,Household 2,Wages - 10&lt;/P&gt;&lt;P&gt;Person 3,Household 1,Wages - 10&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; person,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; household,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wages,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; catx(' ',household,'Wages',sum(input(scan(wages,-1,' -'),? best16.))) as goal length=40&lt;/P&gt;&lt;P&gt;&amp;nbsp; from have&lt;/P&gt;&lt;P&gt;&amp;nbsp; group by household&lt;/P&gt;&lt;P&gt;&amp;nbsp; order by person&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 01:36:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/IF-Then-Statement-tying-multiple-rows-together/m-p/186848#M1150</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-07-21T01:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: IF/Then Statement tying multiple rows together</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/IF-Then-Statement-tying-multiple-rows-together/m-p/186849#M1151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, let me try to be more specific. in a different question.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jul 2014 22:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/IF-Then-Statement-tying-multiple-rows-together/m-p/186849#M1151</guid>
      <dc:creator>Tglass55</dc:creator>
      <dc:date>2014-07-27T22:20:26Z</dc:date>
    </item>
  </channel>
</rss>

