BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
seancho
Calcite | Level 5

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;
1 ACCEPTED SOLUTION

Accepted Solutions
1 REPLY 1

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 340 views
  • 0 likes
  • 2 in conversation