Read a CSV file with SAS IML using R code

49 Views Asked by At

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?

1

There are 1 best solutions below

0
Stu Sztukowski On

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;