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

How would you delete duplicate observations?

9 Answers  


what is the difference between informat$8. $char8.

3 Answers   SAS,


How necessary is it to be creative in your work?

0 Answers   Oracle,


What is PDV?

0 Answers  


Describe a time when you were really stuck on a problem and how you solved it?

1 Answers  


how to remove the duplicates by proc sql?

2 Answers   Genpact,


what is the difference between floor and ceil functions in sas? : Sas-administrator

0 Answers  


PROC SQL always ends with QUIT statement.Why cant you use RUN in PROQ SQL ?

7 Answers   HP,


What is the purpose of trailing @ and @@? How do you use them?

0 Answers  


How would you invoke a macro? : sas-macro

0 Answers  


what are the advantages of using SAS in clinical data mangement? why should not we use other software products in managing clinical data?

2 Answers   Wockhardt,


There is a river notoriously known for it?s large crocodile population. With ease, how do you safely cross it?

1 Answers   Oracle,


Categories