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

DATA EXPER;
INPUT TIME0-TIME4;
DATALINES;
100 200 300 400 500
55 110 130 150 170
;
DATA Minutes;
SET EXPER;
ARRAY TIME[0:4] TIME0 – TIME4;
DO I= 0 TO 4;
TIME[I]= ROUND(TIME[I]/60,.1);
END;
DROP I;
RUN;
PROC PRINT DATA=MINUTES NOOBS;
TITLE “LISTING OF Data set Minutes”;
run;

 

I keep getting the same error regardless if i change the number of variables. 
'Too few variables defined for the dimension(s) specified for the array '- is the error I keep getting. Does anyone have any suggestions as what could be wrong in the code?

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

When I pasted your code into my editor this line

ARRAY TIME[0:4] TIME0 – TIME4;

shows the dash like characer as a box drawing character.

Try retyping the dash with the one on your keyboard.

This kind of character change happens when copying from documents that are not plain text such as Word, which will "helpfully" change some characters.

 

 

 

 

View solution in original post

2 REPLIES 2
ballardw
Super User

When I pasted your code into my editor this line

ARRAY TIME[0:4] TIME0 – TIME4;

shows the dash like characer as a box drawing character.

Try retyping the dash with the one on your keyboard.

This kind of character change happens when copying from documents that are not plain text such as Word, which will "helpfully" change some characters.

 

 

 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 9305 views
  • 0 likes
  • 2 in conversation