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 IS DEBUGGING? HOW TO TEST THE DEBUGGING IN SAS?

3 Answers   Accenture,


What is SAS?

0 Answers  


Are you involved in writing the inferential analysis plan? Tables specfications?

0 Answers   Wipro,


Why Info School? BUILD YOUR CAREER WITH RIGHT GUIDANCE AND SUPPORT

0 Answers  


what are input dataset and output dataset options?

6 Answers   HCL,






tell me about use of arrays in sas

1 Answers   CoreEL,


what is the difference between proc means and proc tabulate?

3 Answers   Cognizant, CTS,


how do you derive descriptive statistics?

1 Answers   Accenture, Quintiles,


What do you feel about hardcoding?

1 Answers  


Under what circumstances would you code a SELECT construct instead of IF statements?

4 Answers  


Do you need to know if there are any missing values?

0 Answers  


what is snowflake schema? : Sas-di

0 Answers  


Categories