<?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: Reffering only a part of array in a function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518437#M140316</link>
    <description>&lt;P&gt;Variable lists are evaluate when SAS is compiling the code. So there is no way that trying to use a run-time concept like an array reference could be used to generate a variable list.&lt;/P&gt;
&lt;P&gt;Just use a DO loop.&amp;nbsp; Or better take advantage of the DO loop you already have.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data IBR.validA;
  set IBR.valid1;
  validA=1;
  array cum{6} cumBE1-cumBE6;
  do i=1 to 6;
    sum_cum=cum(i);
    do n=1 to 5 while (i+n&amp;lt;7);
      sum_cum=sum_cum+cum(i+n);
      if cum{i}&amp;lt;22 and cum{i+n}&amp;lt;22 and sum_cum&amp;gt;44 then do;
        validA=0;
        leave;
      end;
    end;
    if validA=0 then do;
      leave;
    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;
&lt;P&gt;PS Use the Insert SAS code button on the menu bar to paste/edit SAS code in your posts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Dec 2018 15:14:53 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-12-04T15:14:53Z</dc:date>
    <item>
      <title>Reffering only a part of array in a function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518431#M140313</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am new to SAS and a non-native English speaker so I apologize in advance if my question or sentences doesn't make sens.&lt;/P&gt;
&lt;P&gt;I would like to refer to array variables in a sum function inside a do loop so that the value of the argument of the sum function changes at each iteration.&lt;/P&gt;
&lt;P&gt;Here is an example of my data set:&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE5&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE6&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Valid&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;10&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;10&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Where the variables CUMBE1 to 6 are the test results of 6 successive blood test, valid a variable that I would like to create. 0, 10 or 11 are valid results, 22 stand for missing value.&lt;/P&gt;
&lt;P&gt;I would like to eliminate the individuals/observations for which more than one test is missing in between 2 valid tests. So if I have successive “22” at the beginning or at the end it is still valid, what we can’t have is a valid, 2 or more successive invalid and then a valid again, like in&amp;nbsp;the third line of my example.&lt;/P&gt;
&lt;P&gt;To do so, I tried to create a variable named “valid” that would equal 1 for the valid observations and 0 for the invalid. I tried several different codes and ways, including using 0/1 value instead of the numeric 0-10-11-22, by using the ARRAY statement.&lt;/P&gt;
&lt;P&gt;At first I wanted SAS to count the number of "22" in between valid values, and if &amp;gt;1 valid =0, but I couldn’t find how to do so.&lt;/P&gt;
&lt;P&gt;So I tried here to tell SAS that if the sum of the array-variables in-between 2 valid values &amp;gt; 44 (that is at most 11+ 22+ 11 ), then it is not valid.&lt;/P&gt;
&lt;P&gt;Here is my last try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data IBR.validA;
	set IBR.valid1;
	validA=1;
	array cum{6} cumBE1-cumBE6;

	do i=1 to 6;
		do n=1 to 5 while (i+n&amp;lt;7);
			if cum{i}&amp;lt;22 and cum{i+n}&amp;lt;22 and sum(of cum{i}-cum{i+n})&amp;gt;44 then
				do;
					validA=0;
					leave;
				end;
			else;
		end;

		if validA=0 then
			do;
				leave;
			end;
	end;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this is the message in the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;53&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do n=1 to 5 while (i+n&amp;lt;7);&lt;/P&gt;
&lt;P&gt;54&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if cum{i}&amp;lt;22 and cum{i+n}&amp;lt;22 and sum(of cum{i}-cum{i+n})&amp;gt;44 then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;FONT color="#ff0000"&gt; -&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: ), ','.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I mean sum values from cum{i} to cum{i+n}. But if I don’t put the “of” in the sum function, then SAS operates a subtraction of cum{i} minus {i+n} and gives me only valid value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I do for SAS to read the expression “cum{i} – cum{i+n}” as a SAS variable list expression and not as a subtraction? Or&amp;nbsp;is there an&amp;nbsp;other function I could use to sum/to take into account &amp;nbsp;only a part of the array-variables and not all of them (which "sum(of cum{i})" does) ?&lt;/P&gt;
&lt;P&gt;Or, even better, is there maybe a&amp;nbsp; more easiest way of doing this task? &lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://communities.sas.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot for any help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not hesitate too tell&amp;nbsp;me if my question is not clear, I’ll try explain it another way &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 16:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518431#M140313</guid>
      <dc:creator>uyuyuyu</dc:creator>
      <dc:date>2018-12-04T16:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reffering only a part of array in a function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518435#M140315</link>
      <description>&lt;P&gt;Here is the code again because it doesn't seem really easy to read the way it appear in my post :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; IBR.validA;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp; set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; IBR.valid1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;validA=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp; array&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; cum{&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;} cumBE1-cumBE6;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; n=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;while&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (i+n&amp;lt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;7&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; cum{i}&amp;lt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;22&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; cum{i+n}&amp;lt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;22&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sum(cum{i}-cum{i+n})&amp;gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;44&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; validA=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; leave&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp; if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; validA=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;leave&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&amp;nbsp;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518435#M140315</guid>
      <dc:creator>uyuyuyu</dc:creator>
      <dc:date>2018-12-04T15:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reffering only a part of array in a function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518437#M140316</link>
      <description>&lt;P&gt;Variable lists are evaluate when SAS is compiling the code. So there is no way that trying to use a run-time concept like an array reference could be used to generate a variable list.&lt;/P&gt;
&lt;P&gt;Just use a DO loop.&amp;nbsp; Or better take advantage of the DO loop you already have.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data IBR.validA;
  set IBR.valid1;
  validA=1;
  array cum{6} cumBE1-cumBE6;
  do i=1 to 6;
    sum_cum=cum(i);
    do n=1 to 5 while (i+n&amp;lt;7);
      sum_cum=sum_cum+cum(i+n);
      if cum{i}&amp;lt;22 and cum{i+n}&amp;lt;22 and sum_cum&amp;gt;44 then do;
        validA=0;
        leave;
      end;
    end;
    if validA=0 then do;
      leave;
    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;
&lt;P&gt;PS Use the Insert SAS code button on the menu bar to paste/edit SAS code in your posts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:14:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518437#M140316</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-12-04T15:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Reffering only a part of array in a function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518449#M140317</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/228432"&gt;@uyuyuyu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am new to SAS and a non-native English speaker so I apologize in advance if my question or sentences doesn't make sens.&lt;/P&gt;
&lt;P&gt;I would like to refer to array variables in a sum function inside a do loop so that the value of the argument of the sum function changes at each iteration.&lt;/P&gt;
&lt;P&gt;Here is an example of my data set:&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE5&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;CUMBE6&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Valid&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;10&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;10&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;22&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Where the variables CUMBE1 to 6 are the test results of 6 successive blood test, valid a variable that I would like to create. 0, 10 or 11 are valid results, 22 stand for missing value.&lt;/P&gt;
&lt;P&gt;I would like to eliminate the individuals/observations for which more than one test is missing in between 2 valid tests. So if I have successive “22” at the beginning or at the end it is still valid, what we can’t have is a valid, 2 or more successive invalid and then a valid again, like in&amp;nbsp;the third line of my example.&lt;/P&gt;
&lt;P&gt;To do so, I tried to create a variable named “valid” that would equal 1 for the valid observations and 0 for the invalid. I tried several different codes and ways, including using 0/1 value instead of the numeric 0-10-11-22, by using the ARRAY statement.&lt;/P&gt;
&lt;P&gt;At first I wanted SAS to count the number of "22" in between valid values, and if &amp;gt;1 valid =0, but I couldn’t find how to do so.&lt;/P&gt;
&lt;P&gt;So I tried here to tell SAS that if the sum of the array-variables in-between 2 valid values &amp;gt; 44 (that is at most 11+ 22+ 11 ), then it is not valid.&lt;/P&gt;
&lt;P&gt;Here is my last try:&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;&lt;CODE class=" language-sas"&gt;data IBR.validA;
	set IBR.valid1;
	validA=1;
	array cum{6} cumBE1-cumBE6;

	do i=1 to 6;
		do n=1 to 5 while (i+n&amp;lt;7);
			if cum{i}&amp;lt;22 and cum{i+n}&amp;lt;22 and sum(of cum{i}-cum{i+n})&amp;gt;44 then
				do;
					validA=0;
					leave;
				end;
			else;
		end;

		if validA=0 then
			do;
				leave;
			end;
	end;
run;&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this is the message in the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;53&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do n=1 to 5 while (i+n&amp;lt;7);&lt;/P&gt;
&lt;P&gt;54&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if cum{i}&amp;lt;22 and cum{i+n}&amp;lt;22 and sum(of cum{i}-cum{i+n})&amp;gt;44 then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;FONT color="#ff0000"&gt; -&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: ), ','.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I mean sum values from cum{i} to cum{i+n}. But if I don’t put the “of” in the sum function, then SAS operates a subtraction of cum{i} minus {i+n} and gives me only valid value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I do for SAS to read the expression “cum{i} – cum{i+n}” as a SAS variable list expression and not as a subtraction? Or&amp;nbsp;is there an&amp;nbsp;other function I could use to sum/to take into account &amp;nbsp;only a part of the array-variables and not all of them (which "sum(of cum{i})" does) ?&lt;/P&gt;
&lt;P&gt;Or, even better, is there maybe a&amp;nbsp; more easiest way of doing this task? &lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://communities.sas.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot for any help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not hesitate too tell&amp;nbsp;me if my question is not clear, I’ll try explain it another way &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One thing you might want to consider is that SAS has a value of missing available for numeric values, typically indicated by default as a period. Since you are going to have to repeatedly add code to avoid using your value of 22 you perhaps should consider recoding the data once it is in SAS as missing instead of retaining the value of 22. Then the functions available such as Missing, is the current variable missing, or NMISS, how many of the variables have missing values are available. These functions avoid issues like "summing" multiple values to compare if they are all missing such as nmiss(cum[I+], cum[I+2]) = 2 to test for 2 missing values. If you have other variables with different codes for "missing then logic comparing a different sum of values becomes less obvious while the nmiss approach stays the same nmiss(abc[I], abc[I+1]) =2. And nmiss(of cum(*))=6 does work to identify all missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because you have a moderately complex start/stop rule &amp;nbsp;I don't see a simple one line test.&lt;/P&gt;
&lt;P&gt;Note that you only have to test the "betweenness" part of you rule for I= 1 to 3. If the 4th value is valid you cannot have 2 or more invalid between valid results. If the 4th is valid you have either 2 invalid following, which would be at the "end' so the result, assuming not invalid from a lower index comparsion, so not invalid, or at most 1 invalid between it an a valid.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518449#M140317</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-12-04T15:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reffering only a part of array in a function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518485#M140327</link>
      <description>&lt;P&gt;If I understand correctly, see if there is any instance of 2 or more successive 22's between valid (non-22) values, then valid=0.&amp;nbsp; Otherwise valid=1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Declaring the array CUM is the right way to start.&amp;nbsp; But I suggest looping _i from 2 to 6.&amp;nbsp;&amp;nbsp; If there is any instance of cum{_i-1}^=22, followed by cum{_i}=22 and cum{_i+1}=22 then you are halfway there, because this indicates there is a non-22 to the left of successive 22's.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, only when you are halfway, look to the right for a non-22.&amp;nbsp; If you find one then valid=0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise valid=1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input ID CUMBE1 CUMBE2 CUMBE3 CUMBE4 CUMBE5 CUMBE6 expected;
datalines;
1 22 22 10 22 11 22 1  
2  0 11 22 22 22 22 1
3 10 11 22 22 11 11 0
run;
data want (drop=_:);
  set have;
  array cum {*} cumbe1-cumbe6;

  do _i=2 to dim(cum)-1 while (valid^=0);
    if cum{_i-1}^=22 and cum{_i}=22 and cum{_i+1}=22 then valid=0.5;
    if valid=0.5 and cum{_i+1}^=22 then valid=0;
  end;
  if valid^=0 then valid=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "trick" here is to loop over interior array elements ("do _i=2 to dim(cum-1);").&amp;nbsp; Then just use index value _i-1 and _i+1 to look to the left and right.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 16:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/518485#M140327</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-12-04T16:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reffering only a part of array in a function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/519066#M140530</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the delay of my answer, I couldn't work on it yesterday. Thank you for your rapid answer and for the tip about the Insert sas code button &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;Thank&amp;nbsp;you for your proposition, but with the way it is written, sum_cum is a cumulative variable, summing all the cum{i} one iteration after the other&amp;nbsp;until it exceeds 44, which always ends up to happen, and so all my observations are valid=0... &lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://communities.sas.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;&lt;P&gt;But I see the logic behind, and I'll try to apply it &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://communities.sas.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank very much again for answering my question &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day,&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Aline&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 09:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/519066#M140530</guid>
      <dc:creator>uyuyuyu</dc:creator>
      <dc:date>2018-12-06T09:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reffering only a part of array in a function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/519068#M140532</link>
      <description>&lt;P&gt;Hi &lt;FONT color="#000000"&gt;&lt;SPAN class="login-bold"&gt;ballardw, &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="login-bold"&gt;Thank you for answering me! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="login-bold"&gt;Indeed, it seems more handy to work with missing variables, thanks for the advice &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; I haven't been able yet to write a code with the nmiss that&amp;nbsp;works correctly, but at least now it runs, I don't have an error message anymore in the log, so it is already a progress &lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://communities.sas.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="login-bold"&gt;Thank you again very much for answering me! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="login-bold"&gt;Have a nice day,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="login-bold"&gt;Aline. &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 10:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/519068#M140532</guid>
      <dc:creator>uyuyuyu</dc:creator>
      <dc:date>2018-12-06T10:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reffering only a part of array in a function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/519070#M140534</link>
      <description>&lt;P&gt;Haha thank you very very much, it worked perfectly! And it is a simple way to do it &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://communities.sas.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;I will remember this logic of looking right and left, I never thought of it before, thanks for the advice &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a very nice day,&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Aline.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 10:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reffering-only-a-part-of-array-in-a-function/m-p/519070#M140534</guid>
      <dc:creator>uyuyuyu</dc:creator>
      <dc:date>2018-12-06T10:08:37Z</dc:date>
    </item>
  </channel>
</rss>

