<?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: &amp;quot;DO OVER&amp;quot; is Undocumented for SAS 9.4, Right? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712790#M219816</link>
    <description>&lt;P&gt;"Do Over" was pretty much deprecated in SAS 6, I believe. SAS tries to make sure that prior code will run so no errors and will work in existing code. Not documenting a bit of code is one way of saying "it works now but you never know when it might stop and probably should not be using it."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The biggest weakness with the "Do Over", at least in my opinion, what that you really can't use two or more arrays in the same loop.&lt;/P&gt;
&lt;P&gt;Example: The following code will run, not doing much of anything serious:&lt;/P&gt;
&lt;PRE&gt;data junk;
  array x  x1-x5;
  array z {5};
  do over x;
     x=sum(x,1);
/*     z=sum(z,1);*/
  end;
run;&lt;/PRE&gt;
&lt;P&gt;If you un-comment the&amp;nbsp; z= sum() bit however you will get illegal array reference errors. Or anything using Z in that loop.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jan 2021 17:02:00 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-01-20T17:02:00Z</dc:date>
    <item>
      <title>"DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712773#M219810</link>
      <description>&lt;P&gt;I see documentation out there in the SAS site called "CASL Reference" :&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=proccas&amp;amp;docsetTarget=n1enf8paum6q19n1cascbj8z5kpc.htm&amp;amp;locale=en"&gt;SAS Help Center: DO OVER Statement.&lt;/A&gt;&amp;nbsp; That website displays "SAS 9.4/Viya 3.4" on the top left of my web browser.&amp;nbsp; I am weary of using that to support the argument that DO OVER is documented, since I still do not see "Do Over" in the documentation at&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=p0gct6ariiecuhn15jkq8pzfzgef.htm&amp;amp;locale=en"&gt;SAS Help Center: Dictionary of SAS DATA Step Statements&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone know the status?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 16:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712773#M219810</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-01-20T16:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712780#M219811</link>
      <description>&lt;P&gt;I could never find it in the current documentation, so yes, it's undocumented.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 16:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712780#M219811</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-20T16:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712784#M219812</link>
      <description>DO OVER was deprecated in SAS V7.&lt;BR /&gt;&lt;BR /&gt;It's still supported for backwards compatibility,  I usually don't recommend using it in production code but some others on here actively disagree with that stance. &lt;BR /&gt;</description>
      <pubDate>Wed, 20 Jan 2021 16:50:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712784#M219812</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-20T16:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712790#M219816</link>
      <description>&lt;P&gt;"Do Over" was pretty much deprecated in SAS 6, I believe. SAS tries to make sure that prior code will run so no errors and will work in existing code. Not documenting a bit of code is one way of saying "it works now but you never know when it might stop and probably should not be using it."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The biggest weakness with the "Do Over", at least in my opinion, what that you really can't use two or more arrays in the same loop.&lt;/P&gt;
&lt;P&gt;Example: The following code will run, not doing much of anything serious:&lt;/P&gt;
&lt;PRE&gt;data junk;
  array x  x1-x5;
  array z {5};
  do over x;
     x=sum(x,1);
/*     z=sum(z,1);*/
  end;
run;&lt;/PRE&gt;
&lt;P&gt;If you un-comment the&amp;nbsp; z= sum() bit however you will get illegal array reference errors. Or anything using Z in that loop.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 17:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712790#M219816</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-20T17:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712792#M219818</link>
      <description>&lt;P&gt;Re: "DO OVER" is Undocumented for SAS 9.4, Right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps &lt;STRONG&gt;IT IS&lt;/STRONG&gt; documented for SAS 9.4 under CAS/CASL.&amp;nbsp; So it should be said that "it is not documented for 'base SAS programming' "?&amp;nbsp; I think I'm right.&amp;nbsp; Please correct me if you disagree.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for all the insightful responses so far.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 17:05:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712792#M219818</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-01-20T17:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712797#M219822</link>
      <description>&lt;P&gt;Another limitation:&lt;/P&gt;
&lt;P&gt;In old SAS versions -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;DO OVER was defined as &lt;STRONG&gt;implicit&lt;/STRONG&gt;&amp;nbsp; do loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The&amp;nbsp; indexed&amp;nbsp; DO ( as&amp;nbsp; do i=1 to ...) was defined as &lt;STRONG&gt;explicit&lt;/STRONG&gt;&amp;nbsp;do loop&lt;/P&gt;
&lt;P&gt;and it generated an error if the data step used both methods.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 17:27:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712797#M219822</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-01-20T17:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712804#M219825</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Another limitation:&lt;/P&gt;
&lt;P&gt;In old SAS versions -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;DO OVER was defined as &lt;STRONG&gt;implicit&lt;/STRONG&gt;&amp;nbsp; do loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The&amp;nbsp; indexed&amp;nbsp; DO ( as&amp;nbsp; do i=1 to ...) was defined as &lt;STRONG&gt;explicit&lt;/STRONG&gt;&amp;nbsp;do loop&lt;/P&gt;
&lt;P&gt;and it generated an error if the data step used both methods.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I thought I remembered the implicit/explicit convention but since it isn't the current documentation searching for "implicit" didn't come up with arrays.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I remember learning the "Do over" in SAS 5.18 and thought "cool, no need to keep track of indexes". And then immediately ran into the "can't use two arrays in the same loop", not so cool. Just easier not to use it.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 17:36:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712804#M219825</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-20T17:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712808#M219828</link>
      <description>&lt;P&gt;Two different things. One (documented) is a statement in PROC CAS, the other (undocumented) a DATA step statement.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 18:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712808#M219828</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-01-20T18:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712828#M219832</link>
      <description>&lt;P&gt;The also have removed the documentation that you don't have to waste time type the dimension (or even using * as a place holder) when defining the array.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But there is no limitation on use multiple arrays.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You just cannot mix implicit and explicit array indexing for the same array.&lt;/P&gt;
&lt;P&gt;If you don't tell SAS what variable to use for the implicit index then it will use _I_ .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So here is an example where arrays A and C are indexed implicitly and B is indexed explicitly.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data junk;
  array A A1-A5 (5*1);
  array B B1-B5 (5*2);
  array C C1-C5 ;
  do over a;
    c=a+b[_i_];
  end;
  put (_all_) (=);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 18:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712828#M219832</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-20T18:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712889#M219844</link>
      <description>&lt;P&gt;yeah, that's right. thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;.&amp;nbsp; I was trying to recall the index,&amp;nbsp;&lt;FONT face="courier new, courier"&gt;_i_&lt;/FONT&gt;,&amp;nbsp;earlier.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 20:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712889#M219844</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-01-20T20:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712985#M219889</link>
      <description>&lt;P&gt;I like the implicit array and the Do Over syntax. First of all, I like the clean look of it. Also, the syntax makes good sense to me logically: Do this operation over that range of variables. If the syntax does not make sense, I don't know why they replicated it with the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lecompobjref&amp;amp;docsetTarget=p07odyzmifa4y3n10pkcvfdbtn4l.htm&amp;amp;locale=en" target="_self"&gt;Do_Over Hash Object Method&lt;/A&gt; (Available since 9.4).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using multipe Do Over loops though, you have to think about the index variable (_I_ by default).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, this fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   array a a1-a2 (1:2);
   array b b1-b3 (1:3); 

   do over a;
      do over b;
         put a= b=;
      end;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   array a(i) a1-a2 (1:2);
   array b(j) b1-b3 (1:3); 

   do over a;
      do over b;
         put a= b=;
      end;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 10:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712985#M219889</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-01-21T10:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: "DO OVER" is Undocumented for SAS 9.4, Right?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712987#M219891</link>
      <description>&lt;P&gt;Interesting &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 07:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-DO-OVER-quot-is-Undocumented-for-SAS-9-4-Right/m-p/712987#M219891</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-01-21T07:05:28Z</dc:date>
    </item>
  </channel>
</rss>

