how can u import .csv file in to SAS?tell Syntax?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Answer / rajamohan
proc import datafile="externalfile location" out=library.datasetname dbms=csv repalce;
getname=yes;
run;
Is This Answer Correct ? | 0 Yes | 2 No |
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 |
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 |
why is sas considered self-documenting? : Sas programming
In the following DATA step, what is needed for ‘fraction’ to print to the log? data _null_; x=1/3; if x=.3333 then put ‘fraction’; run;
what are the advantages of using SAS in clinical data mangement? why should not we use other software products in managing clinical data?
how do i get last 10obs from a dataset when we don't know about the number of obsevations in that dataset?
What do you understand by the term Normal Distribution?
For clinical entire study how many tables will create approx?
How do you convert basic cube to transaction cube and transaction cube to basic cube?
The below code we are using for creating more than one macro variables in proc sql using into clause. How we can use same code to create macro variables vara, varb, varc instead of var1, var2, var3.? proc sql noprint; select count(distinct(patient)) into :var1 - :var3 from dataset1 group by trtreg1c ; quit;
how do the in= variables improve the capability of a merge? : Sas programming
what are the benefits of data integration? : Sas-di
what is the purpose of _error_? : Sas programming
what is _error_?
2 Answers Axis Bank, Cognizant, JPMorgan Chase,