What SAS statements would you code to read an external raw
data file to a DATA step?
Answers were Sorted based on User's Feedback
Answer / madhu
infile and input statements.
ex:
data m;
infile 'c:\m.txt';
input :xxxx;
run;
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / sankar
use INFLE statement
data dsname;
infile 'path of file' <options>;
input var1 var2................varn;
run;
options like dsd dlm missover firstobs obs ..etc
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / pramod
Using import wizard in file menu also we read an external
raw data file to a data step
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / sastechies
We use SAS statements –
FILENAME – to specify the location of the file
INFILE - Identifies an external file to read with an INPUT
statement
INPUT – to specify the variables that the data is
identified with.
Read more: http://sastechies.blogspot.com/2009/11/sas-
interview-questions.html
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sankar
using proc import procedure
synatax :for text file
proc import datafile='path' out=datasetname
dbms=dlm;
delimiter='specific delimiter';
run;
Is This Answer Correct ? | 1 Yes | 2 No |
i have multiple .csv files in a unix directory. every file is having variable names as header.even for empty file also. suppose take 3 files a.csv b.csv c.csv a.csv contains data as name;age,salary; raja;34;4000; ravi;33;5000; kumar;25;3000; b.csv contains data as name;age,salary; ajay;40;4500; and c.csv contains name;age,salary; (only headers) Now i want to import and append all these files in to a single dataset. i tried infile statement with *.csv to import all at a time. but i m not getting correct data. please help me . its urgent. thank you in advance
We have a string like this "kannafromsalembut" ,from this i want to get only "fromsal" (but one condition with out using substring function)here we can not use scan because in the given string there is no delimeter? so give ans without out using substring ?
Differentiate between ceil and floor functions.
what is the main difference between rename and label? (don't say that they both perform the same function).
how many display types available in sas bi dashboard? : Sas-bi
what is sas enterprise intelligence architecture? : Sas-bi
If you’re not wanting any SAS output from a data step, how would you code the data statement to prevent SAS from producing a set?
how can you improve the performance of a query, If it is excuting very slowly?
How to convert a numeric variable to a character variable?
How would you include common or reuse code to be processed along with your statements?
What is LAG function?How is it used? can any one explain
3 Answers TRE, Verinon Technology Solutions,
What are the data types does SAS contain?