Section 3.7: FILENAME -- Specify an External File Name Rather than write the name of an external file in quotes as part of the INFILE statement in the DATA step, you can enter the FILENAME statement: FILENAME 'c:\project\data\myfile.dat'; For example, OPTIONS formdlim=' ' nocenter ls=78 ps=55; FILENAME fish "c:\project\data\fish.dat"; The word fish, defined in the FILENAME statement, appears in the INFILE statement in the next DATA step. DATA fish; INFILE fish missover lrecl=350 firstobs=4; INPUT id $ a b c x y z; .... RUN; With a FILENAME specification, it is possible to compute how to write data to an external text file. Unlike delarative statements, FILE is an executable statement which can be invoked to choose which file to write to based on a condition. Here's an example: FILENAME even 'c:\t\even.dat'; FILENAME odd 'c:\t\odd.dat'; DATA _null_; DO n = 1 to 5, 7, 8, 11; /* 1 3 5 7 11 are written to odd.dat 2 4 8 are written to even.dat*/ if mod(n,2) = 1 then FILE odd ; else FILE even; PUT n; END; run;