BookmarkSubscribeRSS Feed
Rick_SAS
SAS Super FREQ

> do I have to have it? 

I included that information so that you can easily check the names of the variables in the input matrix. But you can ignore that suggestion if you prefer an alternative. 

Tom
Super User Tom
Super User

Before of course.  Fix the data using normal coding before venturing off into the world of matrix operations.

Tom
Super User Tom
Super User

Fix it before you get into IML.

You have 7 observations and only 6 analysis variables.  If you want to make sure there are 7 analysis variables then just make a new variable that is all missing.

 

In your case you seem to be naming the variable MK1 to MK7 but you didn't create the MK1 variable.

So you can just run this code.

data square;
  length scale $8 mk1-mk7 8 ;
  set psuedo_data;
run;

If you don't know which how many MK variables there should be just first count the number of observations and put it into a macro variable.

proc sql noprint;
select count(*) into :nobs trimmed from psuedo_data;
quit;
data square;
  length scale $8 mk1-mk&nobs 8;
  set psuedo_data;
run;
cleokatt
Calcite | Level 5
yes, that was the problem that my matrix was nx(n-1)

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 18 replies
  • 5560 views
  • 0 likes
  • 5 in conversation