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



What SAS statements would you code to read an external raw data file to a DATA step?..

Answer / madhu

infile and input statements.
ex:
data m;
infile 'c:\m.txt';
input :xxxx;
run;

Is This Answer Correct ?    9 Yes 0 No

What SAS statements would you code to read an external raw data file to a DATA step?..

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

What SAS statements would you code to read an external raw data file to a DATA step?..

Answer / ram

proc import is utilities procedure...so infile is correct

Is This Answer Correct ?    4 Yes 0 No

What SAS statements would you code to read an external raw data file to a DATA step?..

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

What SAS statements would you code to read an external raw data file to a DATA step?..

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

What SAS statements would you code to read an external raw data file to a DATA step?..

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

Post New Answer

More SAS Interview Questions

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

2 Answers   Tech Mahindra,


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 ?

5 Answers  


Differentiate between ceil and floor functions.

0 Answers  


what is the main difference between rename and label? (don't say that they both perform the same function).

11 Answers   Parexel,


how many display types available in sas bi dashboard? : Sas-bi

0 Answers  






what is sas enterprise intelligence architecture? : Sas-bi

0 Answers  


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?

8 Answers   Accenture,


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

2 Answers   Zensar,


How to convert a numeric variable to a character variable?

0 Answers  


How would you include common or reuse code to be processed along with your statements?

3 Answers   Accenture,


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?

0 Answers  


Categories