BookmarkSubscribeRSS Feed
Rakesh21
Calcite | Level 5

Im executing below code in SAS PC and getting an error like "ERROR: (execution) Matrix has not been set to a value."

and the same code executed successfully in SAS STUDIO and SAS EG.

Please help me on this.

 

options compress=no;

%let outputpath=%sysfunc(pathname(facc1,f));

%put outputpath=&outputpath;


DATA work.date;
INPUT percent country $40.;
CARDS;
10 US
12 UK
4 AUSTRALIA
16 GERMANY
8 FRANCE
RUN;

rsubmit;
proc iml;

outputpath = "&outputpath";
submit outputpath / R;
# read in the sas7bdat created in above sas code (FILE INPUT)
#install.packages('sas7bdat')
library("sas7bdat", lib.loc="/usr/lib64/RRO-3.2.2/R-3.2.2/lib64/R/library")
df2 <- read.sas7bdat("date.sas7bdat")
write.csv(df2, "&outputpath/dater.csv", row.names = FALSE)
endsubmit;
quit;
endrsubmit;

1 REPLY 1
Rick_SAS
SAS Super FREQ

You say "The same code executed successfully in SAS STUDIO and SAS EG."  Where are you running it now?

 

If your goal is to transfer data from a SAS data set to an R data frame (and vice versa), you can use the 

EXPORTDATASETTOR subroutine and the IMPORTDATASETFROMR subroutine. There are examples at the linked-to doc pages.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1 reply
  • 889 views
  • 0 likes
  • 2 in conversation