Interview Questions   Tutorials   Discussions   Programs   Videos   

SAS - How can you import .csv file in to SAS?tell Syntax?




528
views
asked mar September 20, 2014 06:30 AM  

How can you import .csv file in to SAS?tell Syntax?


           

1 Answers



 
answered By vishnoiprem   0  

AS users and programmers are familiar with the traditional way in which SAS reads external files such as CSV or TXT files using Filename and Infile statement. For example:

Syntex:

The IMPORT procedure statement arguments:

DATAFILE=

DBMS=

OUT=

REPLACE

Data source statements:

GETNAMES=

Other features:    PRINT procedure

This example imports the following comma-delimited file and creates a temporary SAS data set named WORK.SHOES. GETNAME= is set to 'no', so the variable names in record 1 are not used. DATAROW=2 begins reading data from record 2. "Africa","Boot","Addis Ababa","12","$29,761","$191,821","$769"

Program
 proc import datafile="C:\temp\test.csv"
     out=shoes
     dbms=csv
     replace;
     getnames=no;
run;

proc print;
run;
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert