Previous Page | Next Page

The IMPORT Procedure

Example 3: Importing a Tab-Delimited File


Procedure features:

The IMPORT procedure statement arguments:

DATAFILE=

DBMS=

OUT=

REPLACE

Data source statements:

DATAROW=

DELIMITER=

Other features:

PRINT procedure


This example imports the following tab-delimited file and creates a temporary SAS data set named WORK.CLASS. On an ASCII platform, the hexadecimal representation of a tab is '09'x. On an EBCDIC platform, the hexadecimal representation of a tab is a '05'x. The first observation read will be observation 5 due to the DATAROW= specification. GETNAMES= defaults to 'yes'.

Name     Gender   Age
Joyce    F        11
Thomas   M        11
Jane     F        12
Louise   F        12
James    M        12
John     M        12
Robert   M        12
Alice    F        13
Barbara  F        13
Jeffery  M        13
Carol    F        14
Judy     F        14
Alfred   M        14
Henry    M        14
Jenet    F        15
Mary     F        15
Ronald   M        15
William  M        15
Philip   M        16


Program

proc import datafile='c:\temp\tab.txt'
     out=class
     dbms=dlm
     replace;
     delimiter='09'x;
     datarow=5;
run;

Previous Page | Next Page | Top of Page