Previous Page | Next Page

The IMPORT Procedure

Example 2: Importing a Specific Delimited File Using a Fileref


Procedure features:

The IMPORT procedure statement arguments:

DATAFILE=

DBMS=

OUT=

REPLACE

Data source statements:

GETNAMES=

Other features:

FILENAME statement

PRINT procedure


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
     out=stateinfo
     dbms=dlm
     replace;
     getnames=yes;
run;

proc print;
run;

ods html file="statedata.html";
proc print;
run;
ods html close;

Previous Page | Next Page | Top of Page