how can u import .csv file in to SAS?tell Syntax?

Answers were Sorted based on User's Feedback



how can u import .csv file in to SAS?tell Syntax?..

Answer / enr

To create csv file,we have to open notepad.then ,declaring
the variables.then save the file.like enr.csv
SYNTAX: proc import datafile='external file'
out=<dataset name> dbms=csv replace;
getnames=yes;
proc print data=<dataset name>
run;
eg:proc import datafile='E:\enr.csv'
out=sai
dbms=csv replace;
getnames=yes;
proc print data=sai;
run;

Is This Answer Correct ?    32 Yes 2 No

how can u import .csv file in to SAS?tell Syntax?..

Answer / chiranjeevi

retreving the data we can use import&infile also.
import:
proc import datafile='external file'
out=<dataset name> dbms=csv replace;
getnames=yes;
proc print data=<dataset name>
run;

infile:
data code;
infile'C:\Documents and Settings\admin\Desktop\chiru.csv';
input<variable list>;
run;

Is This Answer Correct ?    13 Yes 1 No

how can u import .csv file in to SAS?tell Syntax?..

Answer / shruthi

data DatasetName(drop = If any);
infile 'Path\CSVFileName.csv' delimiter = ',' ;
informat Var1 $2.;
informat Var2 anydtdte21.;

format Var1 $2.;
format Var2 anydtdte21.;

Input
Var1 $
Var2 $;

run;

Is This Answer Correct ?    14 Yes 7 No

how can u import .csv file in to SAS?tell Syntax?..

Answer / swaroop

proc import datafile="f:\x.csv"
out= x dbms=csv;
run;
proc print;
run;

Is This Answer Correct ?    3 Yes 1 No

how can u import .csv file in to SAS?tell Syntax?..

Answer / rajamohan

proc import datafile="externalfile location" out=library.datasetname dbms=csv repalce;
getname=yes;
run;

Is This Answer Correct ?    0 Yes 2 No

how can u import .csv file in to SAS?tell Syntax?..

Answer / ganesh

by using proc import or through wizard select import data
from file menu and infile statement.


proc import datafile='c:\my .csv' out =gan;
run;

Is This Answer Correct ?    7 Yes 10 No

how can u import .csv file in to SAS?tell Syntax?..

Answer / dupe bassey

You can also use an
ods html file ='c:\user\new.xls';
proc print data=new;
run;
ods html close;

something along those lines

Is This Answer Correct ?    1 Yes 19 No

Post New Answer

More SAS Interview Questions

in the flow of data step processing, what is the first action in a typical data step? : Sas programming

0 Answers  


I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a different functionality. In my program I use bot these data sets. How do I specify which Age variable I want to use?

6 Answers  


What Proc glm does?

0 Answers  


What other SAS features do you use for error trapping and data validation?

2 Answers  


do you need to know if there are any missing values? : Sas programming

0 Answers  






what is change analysis in sas di ? : Sas-di

0 Answers  


how to import HTML files into SAS datasets?

3 Answers   HP,


How to limit decimal places for variable using proc means?

0 Answers  


How would you code a macro statement to produce information on the sas log? This statement can be coded anywhere? : sas-macro

0 Answers  


is there any differnce between proc means and proc summary?

5 Answers  


If you set a label in the data step and call a proc freq on the data, how do you display the data without the labels and just the variables.

1 Answers  


how can you improve the performance of a query, If it is excuting very slowly?

2 Answers   Zensar,


Categories