<?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: array do loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348809#M80811</link>
    <description>&lt;P&gt;I can picture only two cases where that might happen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unlikely, but it would happen if every observation contains 100 in one of the pctvax variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More likely, if you changed the code like this it would also happen:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if pctvax1 or pctvax2 or pctvax3=100 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's neither of those, you might have to show more of the program that you used.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 17:35:27 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-04-10T17:35:27Z</dc:date>
    <item>
      <title>array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348727#M80779</link>
      <description>&lt;P&gt;&lt;SPAN class="local-time"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="lia-message-body lia-component-body" id="messagebodydisplay_0_2"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; buildingname &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;20&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; population  vaxa pctvax1 vax2 pctvax2   vax3 pctvax3    buildingtype &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token keyword"&gt;cards&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;
happy days           	   100  	99   99      96   96       100   100        private
learning tree               20          18   90      18   90        19	  95        public
bean stalk                  50          50  100      50  100        50   100        public
&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;&lt;BR /&gt;I have the data above.  &lt;BR /&gt;&lt;BR /&gt;If any value for pctvax is 100, I need to replace all vax1, vax2, vax3 and pctvax1, pctvax2 and &lt;BR /&gt;pctvax3 with dashes such as below:&lt;BR /&gt;&lt;BR /&gt;buildingname    population	vax1   pctvax1	vax2	pctvax2	vax3	pctvax3 buildingtype&lt;BR /&gt;happy days	   100		 --	--	--	--	--	--	private&lt;BR /&gt;learning tree	    20		18	90	18	90	19	95	public&lt;BR /&gt;bean stalk	    50		--	--	--	--	--	--	public&lt;BR /&gt;&lt;BR /&gt;How would I do that?  Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;I tried this:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;value&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pct&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;100&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"--"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;value&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; nm&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; -&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"--*"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;array&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pcts pctvax1 pctvax2 pctvax3 &lt;/FONT&gt;pct_:;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;array&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; nums vax1 vax2 vax3 nm_:;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;to&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; dim(pcts);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pcts=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;100&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; nums=-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pcts=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;100&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pcts=-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pct_: &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;pct.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; num_: &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;nm.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;I am getting the error array subscript out of range&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token punctuation"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348727#M80779</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-04-10T15:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348731#M80781</link>
      <description>&lt;P&gt;You are using an older style of the ARRAY statement, which permits you to refer to just the array name to identify one of the elements of the array.&amp;nbsp; When doing that, you can't use i as the index to the array.&amp;nbsp; You have to use _i_ instead to control your DO loop:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do _i_ = 1 to dim(pcts);&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:01:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348731#M80781</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T15:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348736#M80783</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; Now the code ran but it converts the 'vax' to -1 where the associated 'pct' was 100 (ie, if pct_vax1 was 100, it converts both pct_ vax1 to 100 and vax1 to -1) but I need now to convert also pct_vax2, vax2, pct_vax3, vax3 all to -1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348736#M80783</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-04-10T15:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348745#M80784</link>
      <description>&lt;P&gt;OK, so we cleared up the syntax.&amp;nbsp; Now we need to clear up the logic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just as an aside, a couple of items are not clear here.&amp;nbsp; Why you have added pct_: and nm_: to these arrays.&amp;nbsp; At least in the sample data you provided, there are no variable names that match.&amp;nbsp; And why are you using arrays at all instead of hard-coding the entire result like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if pctvax1=100 or pctvax2=100 or pctvax3=100 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; pctvax1=-1; pctvax2=-1; pctvax3=-1; vax1=-1; vax2=-1; vax3=-1;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But assuming that this is merely representative data, and you have many more variables to process, this would be an approach that uses arrays:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do _i_=1 to dim(pcts);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if pct=100 then reset_values='Y';&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if reset_values='Y' then do _i_=1 to dim(pcts);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; pcts = -1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; nums = -1;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348745#M80784</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T15:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348750#M80786</link>
      <description>&lt;P&gt;data have;&lt;BR /&gt;input buildingname &amp;amp; $20. population vax1 pctvax1 vax2 pctvax2 vax3 pctvax3 buildingtype $;&lt;BR /&gt;cards;&lt;BR /&gt;happy days 100 99 99 96 96 100 100 private&lt;BR /&gt;learning tree 20 18 90 18 90 19 95 public&lt;BR /&gt;bean stalk 50 50 100 50 100 50 100 public&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc format;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value grp&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.="--";&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;array grp pct: vax: ;&lt;BR /&gt;do _n_=1 to dim( grp);&lt;BR /&gt;if 100 in grp then call missing(of grp{*});&lt;BR /&gt;end;&lt;BR /&gt;format pct: vax: grp.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naveen Srinivasan&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348750#M80786</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-04-10T15:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348780#M80799</link>
      <description>&lt;P&gt;I'm unfamiliar with what pct: means.&amp;nbsp; Does that mean I need to write the array out with all the variable names like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pcts&amp;nbsp; pct_var1 pct_var2 pct_var3?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 16:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348780#M80799</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-04-10T16:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348781#M80800</link>
      <description>&lt;P&gt;Thanks! This, for some reason doesn't work.&amp;nbsp; I tried changing reset values to -1 since I want to keep the columns as number variables. But it still didn't work. Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried hard coding it as you suggested but it changed all the values in the dataset to -1....&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 16:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348781#M80800</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-04-10T16:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348783#M80802</link>
      <description>&lt;P&gt;This is helpful. I forgot to include in my data that we do have some buldings that are missing all num and vax values.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 16:38:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348783#M80802</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-04-10T16:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348789#M80806</link>
      <description>&lt;P&gt;Pct_: means all variable names that begin with the four characters pct_ (which means it's not clear whether you actually have any such variable names in your data).&amp;nbsp; If you only want three variables in your array, then you have already spelled them out using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;array pcts pctvax1 pctvax2 pctvax3;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are there other variables that should be added to that list?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 16:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348789#M80806</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T16:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348791#M80807</link>
      <description>&lt;P&gt;Well, your earlier post suggested that's what you wanted to do.&amp;nbsp; If any pctvax variable is 100, change all 6 variables to -1 (at least for that particular observation).&amp;nbsp; If that's not what you want, you'll have to give a couple of "before and after" examples:&amp;nbsp; what data comes in, and what should come out.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 16:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348791#M80807</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T16:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348792#M80808</link>
      <description>&lt;P&gt;Appreciate the information. No variables need to be added. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 16:48:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348792#M80808</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-04-10T16:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348803#M80809</link>
      <description>&lt;P&gt;Yes, only for that line. I'm not sure why all the num and pct values for the entire dataset is -1 when I hardcode using 'or'.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 17:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348803#M80809</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-04-10T17:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348809#M80811</link>
      <description>&lt;P&gt;I can picture only two cases where that might happen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unlikely, but it would happen if every observation contains 100 in one of the pctvax variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More likely, if you changed the code like this it would also happen:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if pctvax1 or pctvax2 or pctvax3=100 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's neither of those, you might have to show more of the program that you used.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 17:35:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348809#M80811</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T17:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348836#M80829</link>
      <description>You are right!  I changed it inadvertently.  Thanks!&lt;BR /&gt;&lt;BR /&gt;I still need to figure out how to format the values.  I know how to in the proc print listing out each variable with the format name after it or if I export in Excel can use the replace function.  Is there another way?&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Apr 2017 19:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348836#M80829</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-04-10T19:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348841#M80830</link>
      <description>&lt;P&gt;SAS is fairly limited in that respect.&amp;nbsp; An alternative would be to create a set of new character variables, holding the characters that you would like to print (either -- or a set of digits).&amp;nbsp; Then print those new variables instead of the original variables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 19:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/348841#M80830</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T19:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: array do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/349197#M80974</link>
      <description>Yes, excellent idea.  I did this and am double checking my work now. Thanks.&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Apr 2017 17:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-do-loop/m-p/349197#M80974</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-04-11T17:15:19Z</dc:date>
    </item>
  </channel>
</rss>

