<?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: SAS Programming 2: Data Manipulation Techniques Loops in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-Programming-2-Data-Manipulation-Techniques-Loops/m-p/850671#M37267</link>
    <description>&lt;P&gt;This is an &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/default/lestmtsref/p1hglxgj1sjhdzn18soqrqmvogvj.htm" target="_self"&gt;assignment statement&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;&lt;FONT color="#0000FF"&gt;IncrDayVisits=IncrDayVisits*1.06;&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The expression to the right of = is resolved, and the result is assigned to the variable IncrDayVisits. The value of IncrDayVisits will be reinitialized to missing for each iteration of the data step, and if IncrDayVisits is missing when the expression is evaluated, the result of the expression will also be missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/default/lestmtsref/n1dfiqj146yi2cn1maeju9wo7ijs.htm" target="_self"&gt;SUM statement&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;&lt;FONT color="#0000FF"&gt;Year+1;&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The variable to the left of + is an accumulator variable. Accumulator variable values are not automatically reinitialized when the DATA step iterates - the values are instead retained across iterations. After the expression to the right of + is evaluated, and the result is &lt;EM&gt;summed&lt;/EM&gt; to the existing value of the accumulator variable (the equivalent of Year=SUM(Year,1), in this case). Summing will ignore missing values, so if Year is missing, the resulting value of Year is 1.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Dec 2022 20:01:37 GMT</pubDate>
    <dc:creator>SASJedi</dc:creator>
    <dc:date>2022-12-21T20:01:37Z</dc:date>
    <item>
      <title>SAS Programming 2: Data Manipulation Techniques Loops</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Programming-2-Data-Manipulation-Techniques-Loops/m-p/850670#M37266</link>
      <description>&lt;P&gt;Hi everyone! I'm working my way through the SAS Programming 2: Data Manipulation Techniques course. I noticed in the Loops part of the course that some of the expressions in the Do loop require an equal sign and some don't. For example, in Practice p206p04.sas the code reads:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data IncreaseDayVisits;  
    set pg2.np_summary;
    where Reg='NE' and DayVisits&amp;lt;100000;
    IncrDayVisits=DayVisits;
    Year=0;
	do while (IncrDayVisits&amp;lt;100000);
    &lt;FONT color="#0000FF"&gt;	IncrDayVisits=IncrDayVisits*1.06;
    	Year+1;&lt;/FONT&gt;
	end;
    format IncrDayVisits comma12.;
    keep ParkName DayVisits IncrDayVisits Year;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The lines in the above code in blue are both formula expressions, however the first formula requires an assignment of IncrDayVisits= and the second formula doesn't require an assignment with an equal sign.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone clarify what the difference is? Why does one need an assignment statement with an equal sign and the other does not?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 19:48:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Programming-2-Data-Manipulation-Techniques-Loops/m-p/850670#M37266</guid>
      <dc:creator>SASnewb789</dc:creator>
      <dc:date>2022-12-21T19:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming 2: Data Manipulation Techniques Loops</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Programming-2-Data-Manipulation-Techniques-Loops/m-p/850671#M37267</link>
      <description>&lt;P&gt;This is an &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/default/lestmtsref/p1hglxgj1sjhdzn18soqrqmvogvj.htm" target="_self"&gt;assignment statement&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;&lt;FONT color="#0000FF"&gt;IncrDayVisits=IncrDayVisits*1.06;&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The expression to the right of = is resolved, and the result is assigned to the variable IncrDayVisits. The value of IncrDayVisits will be reinitialized to missing for each iteration of the data step, and if IncrDayVisits is missing when the expression is evaluated, the result of the expression will also be missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/default/lestmtsref/n1dfiqj146yi2cn1maeju9wo7ijs.htm" target="_self"&gt;SUM statement&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;&lt;FONT color="#0000FF"&gt;Year+1;&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The variable to the left of + is an accumulator variable. Accumulator variable values are not automatically reinitialized when the DATA step iterates - the values are instead retained across iterations. After the expression to the right of + is evaluated, and the result is &lt;EM&gt;summed&lt;/EM&gt; to the existing value of the accumulator variable (the equivalent of Year=SUM(Year,1), in this case). Summing will ignore missing values, so if Year is missing, the resulting value of Year is 1.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 20:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Programming-2-Data-Manipulation-Techniques-Loops/m-p/850671#M37267</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2022-12-21T20:01:37Z</dc:date>
    </item>
  </channel>
</rss>

