<?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 Assign value following many conditions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-following-many-conditions/m-p/84995#M18282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset ("population") consisting of about 10 000 observations. This dataset contains a variable "CITY", ranged 1 to 79 and a variable "AGE", ranged 0 to 75. In an Excel file, I have a value for each possibilites of these two variables (i.e. 79*76 lines). This variable is in fact a corrected ponderation that I need to assign to the observations of the dataset "population".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose I could a large number of "if then" commands like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if city=1 then do;&lt;/P&gt;&lt;P&gt;if age=0 then pond=1.2;&lt;/P&gt;&lt;P&gt;if age=1 then pond=0.9;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;if city=79 then do;&lt;/P&gt;&lt;P&gt;if age=75 then pond=1.3;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I guess it's not the more efficient way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Jul 2013 18:13:21 GMT</pubDate>
    <dc:creator>Demographer</dc:creator>
    <dc:date>2013-07-20T18:13:21Z</dc:date>
    <item>
      <title>Assign value following many conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-following-many-conditions/m-p/84995#M18282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset ("population") consisting of about 10 000 observations. This dataset contains a variable "CITY", ranged 1 to 79 and a variable "AGE", ranged 0 to 75. In an Excel file, I have a value for each possibilites of these two variables (i.e. 79*76 lines). This variable is in fact a corrected ponderation that I need to assign to the observations of the dataset "population".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose I could a large number of "if then" commands like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if city=1 then do;&lt;/P&gt;&lt;P&gt;if age=0 then pond=1.2;&lt;/P&gt;&lt;P&gt;if age=1 then pond=0.9;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;if city=79 then do;&lt;/P&gt;&lt;P&gt;if age=75 then pond=1.3;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I guess it's not the more efficient way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jul 2013 18:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-value-following-many-conditions/m-p/84995#M18282</guid>
      <dc:creator>Demographer</dc:creator>
      <dc:date>2013-07-20T18:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value following many conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-following-many-conditions/m-p/84996#M18283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Off course there is. Assuming you imported your Excel sheet as a dataset called PONDERATION with columns AGE CITY and POND, the following query will join the two :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table want as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select population.*, ponderation.pond&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from population natural join ponderation;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jul 2013 18:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-value-following-many-conditions/m-p/84996#M18283</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-07-20T18:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value following many conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-following-many-conditions/m-p/84997#M18284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works, thank you.&lt;/P&gt;&lt;P&gt;What means the "natural join" statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jul 2013 21:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-value-following-many-conditions/m-p/84997#M18284</guid>
      <dc:creator>Demographer</dc:creator>
      <dc:date>2013-07-20T21:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value following many conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-following-many-conditions/m-p/84998#M18285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It means join on the columns with the same name. - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jul 2013 22:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-value-following-many-conditions/m-p/84998#M18285</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-07-20T22:27:04Z</dc:date>
    </item>
  </channel>
</rss>

