IMPORT Procedure

Example 2: Importing a Specific Delimited File Using a Fileref

Features:
PROC IMPORT Statement Arguments:
DATAFILE=
DBMS=
GETNAMES=
OUT=
REPLACE

Details

This example imports the following space-delimited file and creates a temporary SAS data set named WORK.STATES.
Region State Capital Bird
South Georgia Atlanta “Brown Thrasher”
South “North Carolina” Raleigh Cardinal
North Connecticut Hartford Robin
West Washington Olympia “American Goldfinch”
Midwest Illinois Springfield Cardinal

Program

filename stdata 'c:\temp\state_data.txt' lrecl=100;
proc import datafile=stdata
   dbms=dlm
	   getnames=yes;
   out=stateinfo
		replace;
run;
proc print;
run;