<?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 Arrays with if.first then in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Arrays-with-if-first-then/m-p/692291#M210870</link>
    <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of writing multiple lines on DATA population2 step, I am trying to use arrays. However, I receive message; "Missing numeric suffix on a numbered variable list"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help? Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA population2;
	SET population;

	by state_2;

	if first.state_2 then cum_1990 = _1990;
	else cum_1990 + _1990;
	if last.state_2 then output;

RUN;


DATA population3;
	SET population;

	by State_2;

	array year_array {30} _1990 - _2019;
	array cum_array {30} _1990cum - _2019cum;

	do i = 1 to 30;
		if first.state_2 then cum_array {i} = year_array {i} ;
		else cum_array {i} + year_array{i};
		if last.state_2 then output;

	end;
RUN;&lt;/PRE&gt;</description>
    <pubDate>Sat, 17 Oct 2020 09:14:34 GMT</pubDate>
    <dc:creator>seancho</dc:creator>
    <dc:date>2020-10-17T09:14:34Z</dc:date>
    <item>
      <title>Arrays with if.first then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-with-if-first-then/m-p/692291#M210870</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of writing multiple lines on DATA population2 step, I am trying to use arrays. However, I receive message; "Missing numeric suffix on a numbered variable list"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help? Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA population2;
	SET population;

	by state_2;

	if first.state_2 then cum_1990 = _1990;
	else cum_1990 + _1990;
	if last.state_2 then output;

RUN;


DATA population3;
	SET population;

	by State_2;

	array year_array {30} _1990 - _2019;
	array cum_array {30} _1990cum - _2019cum;

	do i = 1 to 30;
		if first.state_2 then cum_array {i} = year_array {i} ;
		else cum_array {i} + year_array{i};
		if last.state_2 then output;

	end;
RUN;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Oct 2020 09:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-with-if-first-then/m-p/692291#M210870</guid>
      <dc:creator>seancho</dc:creator>
      <dc:date>2020-10-17T09:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays with if.first then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-with-if-first-then/m-p/692292#M210871</link>
      <description>&lt;P&gt;On a numbered variable list, the numeric suffix has to be at the end of the variable name:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array cum_array {30} _cum1990 - _cum2019;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Oct 2020 09:21:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-with-if-first-then/m-p/692292#M210871</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-17T09:21:16Z</dc:date>
    </item>
  </channel>
</rss>

