<?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: How to use ARRAYS to make program efficient!!! do-loops in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-ARRAYS-to-make-program-efficient-do-loops/m-p/369629#M275592</link>
    <description>&lt;P&gt;Homework assignment: try it and see if it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not, then there are ways of extracting the variables names from DICTIONARY tables into a macro variable that ought to eliminate the need to type all of the variable names.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2017 18:42:34 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2017-06-22T18:42:34Z</dc:date>
    <item>
      <title>How to use ARRAYS to make program efficient!!! do-loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-ARRAYS-to-make-program-efficient-do-loops/m-p/369621#M275589</link>
      <description>&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to make my program more efficient by using Arrays but can't find a way to make it work. Here is the current program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data final;
  merge visitcal tvisit2 eos;
  by subject;
        
	 if END_OF_TREATMENT ne . then do;
                if CYCLE_1_DAY_14  &amp;gt;= END_OF_TREATMENT then  CYCLE_1_DAY_14= .;
		if CYCLE_2_DAY_1   &amp;gt;= END_OF_TREATMENT then  CYCLE_2_DAY_1 = .;
		if CYCLE_2_DAY_15  &amp;gt;= END_OF_TREATMENT then  CYCLE_2_DAY_15= .;
		if CYCLE_3_DAY_1   &amp;gt;= END_OF_TREATMENT then  CYCLE_3_DAY_1 = .;
		if CYCLE_3_DAY_15  &amp;gt;= END_OF_TREATMENT then  CYCLE_3_DAY_15= .;
		if CYCLE_4_DAY_1   &amp;gt;= END_OF_TREATMENT then  CYCLE_4_DAY_1 = .;
		if CYCLE_4_DAY_15  &amp;gt;= END_OF_TREATMENT then  CYCLE_4_DAY_15= .;
		if CYCLE_5_DAY_1   &amp;gt;= END_OF_TREATMENT then  CYCLE_5_DAY_1 = .;
		if CYCLE_5_DAY_15  &amp;gt;= END_OF_TREATMENT then  CYCLE_5_DAY_15= .;
		if CYCLE_6_DAY_1   &amp;gt;= END_OF_TREATMENT then  CYCLE_6_DAY_1 = .;
		if CYCLE_6_DAY_15  &amp;gt;= END_OF_TREATMENT then  CYCLE_6_DAY_15= .;
		if CYCLE_7_DAY_1   &amp;gt;= END_OF_TREATMENT then  CYCLE_7_DAY_1 = .;
		if CYCLE_7_DAY_15  &amp;gt;= END_OF_TREATMENT then  CYCLE_7_DAY_15= .;
		if CYCLE_8_DAY_1   &amp;gt;= END_OF_TREATMENT then  CYCLE_8_DAY_1 = .;
		if CYCLE_8_DAY_15  &amp;gt;= END_OF_TREATMENT then  CYCLE_8_DAY_15= .;
		if CYCLE_9_DAY_1   &amp;gt;= END_OF_TREATMENT then  CYCLE_9_DAY_1 = .;
		if CYCLE_9_DAY_15  &amp;gt;= END_OF_TREATMENT then  CYCLE_9_DAY_15= .;
		if CYCLE_10_DAY_1  &amp;gt;= END_OF_TREATMENT then  CYCLE_10_DAY_1 = .;
		if CYCLE_10_DAY_15 &amp;gt;= END_OF_TREATMENT then  CYCLE_10_DAY_15= .;
		if CYCLE_11_DAY_1  &amp;gt;= END_OF_TREATMENT then  CYCLE_11_DAY_1 = .;
		if CYCLE_11_DAY_15 &amp;gt;= END_OF_TREATMENT then  CYCLE_11_DAY_15= .;
		if CYCLE_12_DAY_1  &amp;gt;= END_OF_TREATMENT then  CYCLE_12_DAY_1 = .;
		if CYCLE_12_DAY_15 &amp;gt;= END_OF_TREATMENT then  CYCLE_12_DAY_15= .;
            end;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I want to make all "Cycles" = . based on the following conditions. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 18:26:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-ARRAYS-to-make-program-efficient-do-loops/m-p/369621#M275589</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2017-06-22T18:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ARRAYS to make program efficient!!! do-loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-ARRAYS-to-make-program-efficient-do-loops/m-p/369624#M275590</link>
      <description>&lt;P&gt;To save myself some typing, I'm not going to type all of your variable names&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;array x CYCLE_1_DAY_14 CYCLE_2_DAY_1 CYCLE_2_DAY_15;
if end_of_treatment ne . then do i=1 to dim(x);
    if x(i)  &amp;gt;= END_OF_TREATMENT then  x(i) = .;
end;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Jun 2017 18:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-ARRAYS-to-make-program-efficient-do-loops/m-p/369624#M275590</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-06-22T18:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ARRAYS to make program efficient!!! do-loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-ARRAYS-to-make-program-efficient-do-loops/m-p/369628#M275591</link>
      <description>thanks for the quick response, but is there a way where i dont have to type all variable names? maybe something like "cycle:" ?</description>
      <pubDate>Thu, 22 Jun 2017 18:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-ARRAYS-to-make-program-efficient-do-loops/m-p/369628#M275591</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2017-06-22T18:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ARRAYS to make program efficient!!! do-loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-ARRAYS-to-make-program-efficient-do-loops/m-p/369629#M275592</link>
      <description>&lt;P&gt;Homework assignment: try it and see if it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not, then there are ways of extracting the variables names from DICTIONARY tables into a macro variable that ought to eliminate the need to type all of the variable names.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 18:42:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-ARRAYS-to-make-program-efficient-do-loops/m-p/369629#M275592</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-06-22T18:42:34Z</dc:date>
    </item>
  </channel>
</rss>

