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 sas/access and sas/connect? : Sas programming

0 Answers  


how do you validate sas program?

6 Answers   Accenture,


How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?

0 Answers  


what is the difference between the SAS v8 and SAS v9?

7 Answers   TCS,


In a shcool there are 1000 students. After completion of every test in 6 subjects , each subject teacher submit the marks of every student at different times and loaded in the database commonly. How will you seperate the top two subject marks for each each studet using SAS?

6 Answers  






What r all the reporting procedures...?

3 Answers  


What is the pound sign used for in the data_null_ ?

1 Answers  


why a stop statement is needed for the point= option on a set statement?

0 Answers  


Can we use where and having clauses in a single SAS program. ex: proc sql;     select a,b,c from test      where state in 'KA'      and having <some condition>. Is the above program run correctly, if not why ?     

4 Answers   UHG,


What system options would you use to help debug a macro? : sas-macro

0 Answers  


Hi Friends, Am Priya,new to your forum. am looking for Interview questions on SAS Platform Administration. I searched everywhere but I couldn't find them,please can anyone help me with complete interview questions normally everyone will face in the interviews on SAS Administration. am really facing problems in the interviews,am not able to answer any of their questions. I would really appreciate all your help if you can email the complete Interview Questions to priyafeb84@gmail.com Kindly awaiting for your reply with eager

0 Answers  


Which date functions advances a date time or date/time value by agiven interval?

3 Answers  


Categories