How to include or exclude specific variables in a data set?



How to include or exclude specific variables in a data set?..

Answer / Santoh Kumar

"In SAS, you can use theKEEP and DROP options within a DATA step to include or exclude specific variables respectively. For example: data new_dataset (keep=var1 var2); set old_dataset; end; will create a new dataset named new_dataset that only includes the variables var1 and var2 from the old_dataset.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SAS Interview Questions

what are the best practices to process the large data sets in sas programming? : Sas-administrator

1 Answers  


i have a dataset with 100 obs i want to generate title from 20th obs onwards with total observations. that should contain 100 obs.dont use firstobs and dnt split the data. use dataset block or proc report? how can we genarate;

1 Answers   L&T,


How does the internal authentication work in sas? : sas-grid-administration

1 Answers  


Can you execute macro within another macro? : sas-macro

1 Answers  


What function CATX syntax does?

1 Answers  


describe the interaction table in sas di? : Sas-di

1 Answers  


What are the different types of sas functions?

1 Answers  


where are dashboard components are created and maintained? : Sas-bi

1 Answers  


Explain the difference between informat and format with an example.

1 Answers  


How would you code a macro statement to produce information on the sas log? This statement can be coded anywhere? : sas-macro

1 Answers  


Differences between where and if statement?

1 Answers  


what is Global Symbol table and Local symbol table?

4 Answers   CitiGroup,


Categories