Programming Tip 2

h

In the previous section, we created a file reference called REFFILE

We then referenced it in the Proc Import DATAFILE option:

This step is actually not required.

We can directly specify the path in the DATAFILE option without using the file reference.

​For example, the code below works exactly the same:

PROC IMPORT DATAFILE='/home/kisumsam/proc_import/excel_practice_01.xlsx'
	DBMS=XLSX
	OUT=WORK.IMPORT
	REPLACE;
	GETNAMES=YES;
RUN;

Using the FILEREF is, however, recommended since it generally makes the code look cleaner.