I am trying to do matrix operations on SAS using a dataset I call 'ao' which has 7 variables and which I have attached. As an experiment, I am doing a scalar operation on the data I read in as a matrix, and I want to output it back out as a sas dataset using the following code:
proc iml;
use aoy;
read all var _ALL_ into Gamma[colname=varNames];
y=2*Gamma;
close ao;
create test from y[colname={"ind2" "MRP" "SMB" "HML" "RMW" "CMA" "RF"}];;
append from test;
close test;
quit;
For some reason SAS gives me the error message:"Number of columns in test does not match with the number of variables in the data set". I don't see how this is posssible because the dataset has exactly 7 variables. Please let me know if there is anything wrong with the code. I have attached the dataset for convenience.