<?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 Updating Table with New Variable in SAS Sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Updating-Table-with-New-Variable-in-SAS-Sql/m-p/534482#M146665</link>
    <description>&lt;P&gt;I am trying to update a table in SAS with a new variable. I want the salary column to be multiplied by different numbers depending on position. This is the code I have been using, but it giving me an error saying that modsal isn't a variable and also giving an error when I am trying to set the position to the number I am multiplying by saying there is a syntax error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC sql;&lt;BR /&gt;UPDATE work.baseball2&lt;BR /&gt;SET modsal = salary*case label ="Modern Salary Equivelent"&lt;BR /&gt;WHEN position = 'C' then 5&lt;BR /&gt;WHEN position = ('1B','2B','SS','3B') then 6&lt;BR /&gt;WHEN position =  ('RF','LF','CF','DH') then 8&lt;BR /&gt;END;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Feb 2019 15:04:00 GMT</pubDate>
    <dc:creator>Steelersgirl</dc:creator>
    <dc:date>2019-02-11T15:04:00Z</dc:date>
    <item>
      <title>Updating Table with New Variable in SAS Sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-Table-with-New-Variable-in-SAS-Sql/m-p/534482#M146665</link>
      <description>&lt;P&gt;I am trying to update a table in SAS with a new variable. I want the salary column to be multiplied by different numbers depending on position. This is the code I have been using, but it giving me an error saying that modsal isn't a variable and also giving an error when I am trying to set the position to the number I am multiplying by saying there is a syntax error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC sql;&lt;BR /&gt;UPDATE work.baseball2&lt;BR /&gt;SET modsal = salary*case label ="Modern Salary Equivelent"&lt;BR /&gt;WHEN position = 'C' then 5&lt;BR /&gt;WHEN position = ('1B','2B','SS','3B') then 6&lt;BR /&gt;WHEN position =  ('RF','LF','CF','DH') then 8&lt;BR /&gt;END;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Feb 2019 15:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-Table-with-New-Variable-in-SAS-Sql/m-p/534482#M146665</guid>
      <dc:creator>Steelersgirl</dc:creator>
      <dc:date>2019-02-11T15:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Updating Table with New Variable in SAS Sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-Table-with-New-Variable-in-SAS-Sql/m-p/534484#M146666</link>
      <description>&lt;P&gt;this part definitely needs correction&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WHEN position = 'C' then 5
WHEN position in ('1B','2B','SS','3B') then 6
WHEN position in  ('RF','LF','CF','DH') then 8&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Feb 2019 15:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-Table-with-New-Variable-in-SAS-Sql/m-p/534484#M146666</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-02-11T15:06:52Z</dc:date>
    </item>
  </channel>
</rss>

