giorgio_b
giorgio_b

Reputation: 11

Read a CSV file with SAS IML using R code

I try to read a csv file with this code:

%let path= C:\Users\b\file_holidays;

libname bic "&path.\input";

proc iml;

submit  bic / R;

bankholidays=read.csv(file.path(bic, "Bankholidays.csv"))

endsubmit;

quit;

but I have the error

"object 'bic' not found".

May you help me?

Upvotes: 0

Views: 68

Answers (1)

Stu Sztukowski
Stu Sztukowski

Reputation: 12909

bic is a libref and is not a parameter within IML. You can simply reference the path of your libname, assuming that is where you want to output sas7bdat files later. Otherwise, you do not need the libname statement.

%let path= C:\Users\b\file_holidays;

libname bic "&path.\input";

proc iml;
    submit / R;
        bankholidays=read.csv(file.path("%sysfunc(pathname(bic))", "Bankholidays.csv"))
    endsubmit;
quit;

Upvotes: 0

Related Questions