<?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 Auto Indenter bug ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Auto-Indenter-bug/m-p/628972#M185923</link>
    <description>&lt;P&gt;The following "do I=1 to 2" code will fail after Auto Indenter is run using CTRL-I on SAS EG. The error only occurs when the do loop is part of an "else if" condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input col1$ col2;
datalines;
a 0123
b 345
b 456
d 711189
x    
u 3033
w 1234567890
run;

data want1;
set have;
if col1 = 'b' then do;
	new = cats('b', col2); output; end;
else if col1 = 'd' then do i= 1 to 2;
	if i = 1 then do; new = cats('d', col2); output; end;
	if i = 2 then do; new = cats('db', col2); output; end;
	end;
run;

data want2;
set have;
if col1 = 'b' then do i= 1 to 2;
	if i = 1 then do; new = cats('b', col2); output; end;
	if i = 2 then do; new = cats('bc', col2); output; end;
	end;
else if col1 = 'd' then do;
	new = cats('d', col2); output; end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;After CRTL-I there is an extra semi colon between the do and I = 1 to 2&lt;/P&gt;&lt;PRE&gt;data want1;
	set have;

	if col1 = 'b' then
		do;
			new = cats('b', col2);
			output;
		end;
	else if col1 = 'd' then
		do;
			i= 1 to 2;

			if i = 1 then
				do;
					new = cats('d', col2);
					output;
				end;

			if i = 2 then
				do;
					new = cats('db', col2);
					output;
				end;
		end;
run;&lt;/PRE&gt;&lt;P&gt;Is there some Indenter option I have set incorrectly ?&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2020 23:56:55 GMT</pubDate>
    <dc:creator>simmwa</dc:creator>
    <dc:date>2020-03-02T23:56:55Z</dc:date>
    <item>
      <title>Auto Indenter bug ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Auto-Indenter-bug/m-p/628972#M185923</link>
      <description>&lt;P&gt;The following "do I=1 to 2" code will fail after Auto Indenter is run using CTRL-I on SAS EG. The error only occurs when the do loop is part of an "else if" condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input col1$ col2;
datalines;
a 0123
b 345
b 456
d 711189
x    
u 3033
w 1234567890
run;

data want1;
set have;
if col1 = 'b' then do;
	new = cats('b', col2); output; end;
else if col1 = 'd' then do i= 1 to 2;
	if i = 1 then do; new = cats('d', col2); output; end;
	if i = 2 then do; new = cats('db', col2); output; end;
	end;
run;

data want2;
set have;
if col1 = 'b' then do i= 1 to 2;
	if i = 1 then do; new = cats('b', col2); output; end;
	if i = 2 then do; new = cats('bc', col2); output; end;
	end;
else if col1 = 'd' then do;
	new = cats('d', col2); output; end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;After CRTL-I there is an extra semi colon between the do and I = 1 to 2&lt;/P&gt;&lt;PRE&gt;data want1;
	set have;

	if col1 = 'b' then
		do;
			new = cats('b', col2);
			output;
		end;
	else if col1 = 'd' then
		do;
			i= 1 to 2;

			if i = 1 then
				do;
					new = cats('d', col2);
					output;
				end;

			if i = 2 then
				do;
					new = cats('db', col2);
					output;
				end;
		end;
run;&lt;/PRE&gt;&lt;P&gt;Is there some Indenter option I have set incorrectly ?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 23:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Auto-Indenter-bug/m-p/628972#M185923</guid>
      <dc:creator>simmwa</dc:creator>
      <dc:date>2020-03-02T23:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Indenter bug ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Auto-Indenter-bug/m-p/628979#M185927</link>
      <description>&lt;P&gt;Using SAS EG8.2 I can replicate what you describe. It looks like formatting code adds a semicolon to the code....&lt;/P&gt;
&lt;P&gt;Looks like a bug to me. Can you please raise this with &lt;A href="https://support.sas.com/en/technical-support/contact-sas.html" target="_self"&gt;SAS Technical Support&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Before formatting the code&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 527px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36524iE900C540F8BC0B55/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;After formatting the code&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 311px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36525i7EEDF553DC3545ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 00:14:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Auto-Indenter-bug/m-p/628979#M185927</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-03T00:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Indenter bug ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Auto-Indenter-bug/m-p/631116#M186927</link>
      <description>&lt;P&gt;SAS Technical support were able to replicate and are now working on a fix.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 21:49:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Auto-Indenter-bug/m-p/631116#M186927</guid>
      <dc:creator>simmwa</dc:creator>
      <dc:date>2020-03-10T21:49:03Z</dc:date>
    </item>
  </channel>
</rss>

