<?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 Errors when trying to add new column to existing data set in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Errors-when-trying-to-add-new-column-to-existing-data-set/m-p/511847#M2257</link>
    <description>&lt;P&gt;I am trying to add a column named "ADM_YN" to an existing data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I input:&lt;/P&gt;&lt;P&gt;data=DID.MLIP101;&lt;BR /&gt;set=DID.MLIP1;&lt;BR /&gt;IF Antidepressants__ gt 0 THEN ADM_YN= "y";&lt;BR /&gt;IF Antidepressants__= 0 THEN ADM_YN= "n";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error for every line:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Nov 2018 21:42:13 GMT</pubDate>
    <dc:creator>dkeine</dc:creator>
    <dc:date>2018-11-09T21:42:13Z</dc:date>
    <item>
      <title>Errors when trying to add new column to existing data set</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Errors-when-trying-to-add-new-column-to-existing-data-set/m-p/511847#M2257</link>
      <description>&lt;P&gt;I am trying to add a column named "ADM_YN" to an existing data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I input:&lt;/P&gt;&lt;P&gt;data=DID.MLIP101;&lt;BR /&gt;set=DID.MLIP1;&lt;BR /&gt;IF Antidepressants__ gt 0 THEN ADM_YN= "y";&lt;BR /&gt;IF Antidepressants__= 0 THEN ADM_YN= "n";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error for every line:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 21:42:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Errors-when-trying-to-add-new-column-to-existing-data-set/m-p/511847#M2257</guid>
      <dc:creator>dkeine</dc:creator>
      <dc:date>2018-11-09T21:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Errors when trying to add new column to existing data set</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Errors-when-trying-to-add-new-column-to-existing-data-set/m-p/511848#M2258</link>
      <description>&lt;P&gt;Code should be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data   DID.MLIP101;
  set   DID.MLIP1;
         IF Antidepressants__   gt 0 THEN ADM_YN= "y";
         IF Antidepressants__    = 0 THEN ADM_YN= "n";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Nov 2018 21:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Errors-when-trying-to-add-new-column-to-existing-data-set/m-p/511848#M2258</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-11-09T21:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Errors when trying to add new column to existing data set</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Errors-when-trying-to-add-new-column-to-existing-data-set/m-p/511859#M2259</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/245605"&gt;@dkeine&lt;/a&gt;&amp;nbsp; Welcome to the SAS forum. In addition to the correction you received , since your conditions are mutually exclusive, you are better off adding a else if&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;   DID&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;MLIP101&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt;   DID&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;MLIP1&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
         &lt;SPAN class="token keyword"&gt;IF&lt;/SPAN&gt; Antidepressants__   &lt;SPAN class="token operator"&gt;gt&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;THEN&lt;/SPAN&gt; ADM_YN&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"y"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
         else &lt;SPAN class="token keyword"&gt;IF&lt;/SPAN&gt; Antidepressants__    &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;THEN&lt;/SPAN&gt; ADM_YN&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"n"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;/*else if*/&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Nov 2018 22:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Errors-when-trying-to-add-new-column-to-existing-data-set/m-p/511859#M2259</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-09T22:25:34Z</dc:date>
    </item>
  </channel>
</rss>

