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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 861 views
  • 0 likes
  • 2 in conversation