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

what is the SAS/ACCESS and SAS/CONNECT?

9 Answers   Accenture, iFlex, TCS,


how to read raw data in sas. Do it manually and throw the programming.

1 Answers   WNS,


what is the difference between SET and MERGE?

19 Answers   CitiGroup,


How to include or exclude specific variables in a data set?

0 Answers  


Code a PROC SORT on a data set containing State, District and County as the primary variables, along with several numeric variables.

7 Answers   Accenture,






Name any two sas spawners? : sas-grid-administration

0 Answers  


Dear all, proc means data=dsn noprint completetypes; class trtmntgroup /preloadfmt; output out=tot n=n; format trtmntgroup trtf. ; by vstgrp descending severity; run; This is the code I used for AE table. I got the values without giving the variable ‘trtmntgroup(numeric)’ in var statement. And if I give the var statement for that variable i’m getting the same values.How is that possible? What is the difference between class and var statement? Could any one explain me how does proc means work at the back end. And what is the difference between _freq_ value and N value in proc means. Thanks and regards, Rajesh.

1 Answers  


what is intially documentation for a sas programmer?

2 Answers   Accenture,


what is sas application server, database server, sas olap server and sas metadata server? : Sas-di

0 Answers  


how do we get duplicate observations in a separate dataset?

6 Answers   CitiGroup,


I have a dataset concat having variable a b & c. How to rename a b to e & f?

0 Answers  


How does proc sql work?

0 Answers  


Categories