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

Hi,

 

I'm simply trying to read an existing dataset into a matrix, but keep recieving the same error, that I can't fix.

 

The message is: ERROR: A dataset field name is not a valid IML symbol name.

 

Here's the code:

proc iml;
use points;
	read all var _ALL_ into runs;
	close points;
	print runs;

What's triggering the error?

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

The USE statement in SAS/IML reads data from a SAS data set.  Valid variable names in SAS begins with a letter or an underscore.  In your data, try using variable names such as X0_0, X0_1, etc.  How did you create this data set? 

View solution in original post

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

Your code seems to be working fine as below, so my guess is that one of your column names are conflicting with SAS standards.

 

Can you post some sample of the data you are trying to read?

 

data points;
input ID point;
datalines;
1 100
2 200
3 300
;

proc iml;
use points;
	read all var _ALL_ into runs;
close points;

print runs;
quit;
jl1005
Obsidian | Level 7

Here'sa a picture. I don't need the first column. Would it be because that coumn names are numeric?

 

events snip.JPG

Rick_SAS
SAS Super FREQ

The USE statement in SAS/IML reads data from a SAS data set.  Valid variable names in SAS begins with a letter or an underscore.  In your data, try using variable names such as X0_0, X0_1, etc.  How did you create this data set? 

jl1005
Obsidian | Level 7

The dataset was imported from an excel worksheet. I renamed the columns so they begin with a letter, and it works. Thank you.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 4 replies
  • 1639 views
  • 3 likes
  • 3 in conversation