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

Which is the best training institute for SAS in Delhi. Please reply

12 Answers   HCL, HSBC,


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

11 Answers   Parexel,


What are the special input delimiters used in SAS?

0 Answers  


What are the functions done while Compilation...?

1 Answers   TCS,


How experienced are you with customized reporting and use of Data _Null_ features?

4 Answers   Oracle,






What is the Program Data Vector (PDV) and What are its functions?

9 Answers  


I am having a stored process.it needs to route my report to both hthml and Xls.By default SP routes to html.I used the PRINTTO to route the html to Xls.BUt it createsthe file not but no content was written to file(0KB)?how can i do it?

1 Answers  


If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable?

3 Answers  


For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration

0 Answers  


Which is Best Institute for learning SAS BASE & SAS BI in Hyderabad? Can anyone suggest me ?

5 Answers   ACC,


What is the basic syntax of a sas program?

0 Answers  


Do you use PROC REPORT or PROC TABULATE? Which do you prefer? Explain.

3 Answers  


Categories