Hello all,
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"
Could you please help? Thank you in advance!
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;
On a numbered variable list, the numeric suffix has to be at the end of the variable name:
array cum_array {30} _cum1990 - _cum2019;
On a numbered variable list, the numeric suffix has to be at the end of the variable name:
array cum_array {30} _cum1990 - _cum2019;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.