<?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: New variable assignment not working? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/New-variable-assignment-not-working/m-p/206513#M38376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Jun 2015 16:07:08 GMT</pubDate>
    <dc:creator>jiangmi</dc:creator>
    <dc:date>2015-06-15T16:07:08Z</dc:date>
    <item>
      <title>New variable assignment not working?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/New-variable-assignment-not-working/m-p/206511#M38374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, All,&lt;/P&gt;&lt;P&gt;I am a little confused that variable age2 is not showing up.&lt;/P&gt;&lt;P&gt;It will work if&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;SPAN style="font-size: 13.3333330154419px;"&gt;age2=age*1;&lt;/SPAN&gt;'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; was put behind&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;SPAN style="font-size: 13.3333330154419px;"&gt;set have;&lt;/SPAN&gt;'&amp;nbsp;&amp;nbsp; . &lt;/P&gt;&lt;P&gt;Can somebody tell me why?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input sex$ age;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;F 14&lt;/P&gt;&lt;P&gt;M 15&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data male female;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if sex='M' then output male;&lt;/P&gt;&lt;P&gt;else if sex='F' then output female;&lt;/P&gt;&lt;P&gt;age2=age*1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 15:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/New-variable-assignment-not-working/m-p/206511#M38374</guid>
      <dc:creator>jiangmi</dc:creator>
      <dc:date>2015-06-15T15:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: New variable assignment not working?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/New-variable-assignment-not-working/m-p/206512#M38375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Order of operations. Your output statement is before the calculation, so when SAS writes out the observation it hasn't been calculated yet.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You do get the age2 variable but it is all missing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 16:02:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/New-variable-assignment-not-working/m-p/206512#M38375</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-06-15T16:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: New variable assignment not working?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/New-variable-assignment-not-working/m-p/206513#M38376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 16:07:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/New-variable-assignment-not-working/m-p/206513#M38376</guid>
      <dc:creator>jiangmi</dc:creator>
      <dc:date>2015-06-15T16:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: New variable assignment not working?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/New-variable-assignment-not-working/m-p/206514#M38377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the below set of code ,by moving the age2 before the output statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data have;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;input sex$ age;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;datalines;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;F 14&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;M 15&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data male female;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set have;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;age2=age*1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if sex='M' then output male;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;else if sex='F' then output female;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2015 11:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/New-variable-assignment-not-working/m-p/206514#M38377</guid>
      <dc:creator>naveen20jan</dc:creator>
      <dc:date>2015-06-16T11:05:58Z</dc:date>
    </item>
  </channel>
</rss>

