You can also include
data files (such as XLS, TXT, and CSV) in a repository. In the Snippets
Repository, the import
folder contains
three data files: auto.xls
, delimiter.txt
,
and sample.csv
.
Here is the content
of the import_xls.sas file:
filename url url "{baseURL}/auto.xls";
filename xls temp;
data _null_;
infile url recfm=f lrecl=1;
file xls recfm=f lrecl=1;
input x $char1.; put x $char1.;
run;
proc import out = WORK.auto1 datafile=xls
dbms=xls replace;
sheet="auto1";
getnames=yes;
run;
proc print;
run;
This code assumes that
the SAS server can access URLs where the repository resides by leveraging
the power of the FILENAME Statement, URL Access Method. The SAS code
is saved in the same location as the external file. You can reference
this data from your SAS code by using {baseURL}
,
which resolves the repository URL when accessed.
For more information
about the FILENAME statement, URL Access Method, see SAS Statements: Reference.