<?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: DATA Step adding variables in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/DATA-Step-adding-variables/m-p/466314#M30224</link>
    <description>&lt;P&gt;Try&amp;nbsp; a SUM statement if you want to add them up across your whole dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data work.Test2;
	SET work.Test1;
	Total + INAa + INDa + IRSa + INIa;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 May 2018 05:30:22 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2018-05-31T05:30:22Z</dc:date>
    <item>
      <title>DATA Step adding variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/DATA-Step-adding-variables/m-p/466312#M30222</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the IF statements to allocate numbers to variables, then I need to create a new variable that shows the total of these.&lt;/P&gt;&lt;P&gt;But when I use I create the new variable in another data step it doesn't add them together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IF Active_INAa &amp;gt; ' ' THEN
		INAa = 1;

	IF Active_INDa  &amp;gt; ' '  THEN
		INDa = 2;

	IF Active_IRSa  &amp;gt; ' '  THEN
		IRSa = 4;

	IF Active_INIa  &amp;gt; ' '  THEN
		INIa = 8;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data work.Test2;
	SET work.Test1;
	Total = INAa + INDa + IRSa + INIa;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;EM&gt;Total&lt;/EM&gt; column is created but is blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing here? Any help appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dean&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 05:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/DATA-Step-adding-variables/m-p/466312#M30222</guid>
      <dc:creator>DME790</dc:creator>
      <dc:date>2018-05-31T05:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: DATA Step adding variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/DATA-Step-adding-variables/m-p/466313#M30223</link>
      <description>&lt;P&gt;missing+value=missing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;total=sum(INAa ,INDa , IRSa, INIa)&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 05:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/DATA-Step-adding-variables/m-p/466313#M30223</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-31T05:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: DATA Step adding variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/DATA-Step-adding-variables/m-p/466314#M30224</link>
      <description>&lt;P&gt;Try&amp;nbsp; a SUM statement if you want to add them up across your whole dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data work.Test2;
	SET work.Test1;
	Total + INAa + INDa + IRSa + INIa;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 05:30:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/DATA-Step-adding-variables/m-p/466314#M30224</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-05-31T05:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: DATA Step adding variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/DATA-Step-adding-variables/m-p/466317#M30225</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dean&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 05:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/DATA-Step-adding-variables/m-p/466317#M30225</guid>
      <dc:creator>DME790</dc:creator>
      <dc:date>2018-05-31T05:31:51Z</dc:date>
    </item>
  </channel>
</rss>

