If you have a data set that contains 100 variables, but you
need only five of those, what is the code to force SAS to
use only those variable?

Answers were Sorted based on User's Feedback



If you have a data set that contains 100 variables, but you need only five of those, what is the co..

Answer / sindhura

new_data_set ( will have the five variables with variable
names var1, var2, var3, var4, var5)


data new_data_set;
set old_data_set( keep = var1 var2 var3 var4 var5);
run;

Is This Answer Correct ?    0 Yes 0 No

If you have a data set that contains 100 variables, but you need only five of those, what is the co..

Answer / mohan reddy

U CAN USE THE KEEP OPTION.

EX

DATA EMP(KEEP=NAME AGE SAL ADD LOC);
SET EMPLOYEE;
RUN;

Is This Answer Correct ?    3 Yes 4 No

If you have a data set that contains 100 variables, but you need only five of those, what is the co..

Answer / srilatha

by using the views.
ex: proc sql;
create view emp_v
as
select empno,sal,deptno,comm from emp;
quit;

Is This Answer Correct ?    0 Yes 1 No

If you have a data set that contains 100 variables, but you need only five of those, what is the co..

Answer / raj

var

Is This Answer Correct ?    0 Yes 2 No

If you have a data set that contains 100 variables, but you need only five of those, what is the co..

Answer / sivanjaneyulu

nothing

Is This Answer Correct ?    0 Yes 7 No

If you have a data set that contains 100 variables, but you need only five of those, what is the co..

Answer / sandeep reddy

I think we have to use OBS=5
and mention FIRSTOBS=(THE FIRST OBSERVATION FROM WHERE U
WANT)

Is This Answer Correct ?    1 Yes 19 No

Post New Answer

More SAS Interview Questions

what are the new features included in the new version of SAS i.e., SAS9.1.3?

5 Answers   College School Exams Tests, Wockhardt,


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,


You need to create an In List that it is to be later used in a Where Clause that includes all the Regions that begin with the letter A from the sashelp.shoes table. Using PROC SQL with an into clause create the following string from the sashelp.shoes table using the variable region “AFRICA”,”ASIA”,…..

3 Answers  


Name validation tools used in SAS

0 Answers  


Describe how you would pass data to macro.

3 Answers  






how would you determine the number of missing or nonmissing values in computations? : Sas programming

0 Answers  


Describe the function and untility of the most difficult SAS macro that you have written.

0 Answers  


what is prime numbers? how we can get plc write sas code?

5 Answers   Icon,


Can you suggest us materials for sdtm mapping?

0 Answers   TCS,


What is the command used to find missing values?

0 Answers  


What Proc glm does?

0 Answers  


how do you validate sas program?

6 Answers   Accenture,


Categories