How to select the observations randomly from a SAS dataset

Answer Posted / learner

By using ranuni function. for example you want select 30
percent of data randamly from a data set.

data x;
set y;
if ranuni(100)<.3 ;
run;

here 100 is the seed. the number generated depends on this
seed .

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain the key concept of sas? : Sas-administrator

787


Explain the main difference between the sas procedures and functions? : Sas-administrator

839


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

1883


How does proc sql work?

864


What is data _null_?

927


How can you create a macro variable with in data step? : sas-macro

813


Why and when do you use proc sql?

1001


Describe crosslist option in tables statement?

976


How do you test for missing values?

1338


Differentiate between format and informat? : sas-grid-administration

838


what is the effect of the options statement errors=1? : Sas programming

849


Name few SAS functions?

901


Will it bother you if the guy at the next desk times the frequency and duration of your bathroom or coffee breaks on the grounds that ?you are getting paid twice as much as he is??

2390


What are the different operating system platforms in which we can use sas? : sas-grid-administration

844


please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??

1926