i have a dataset with 100000 records. i want 100 records
from that dataset and create a dataset.we need to pick the
observations random order like
100obs,500obs,1020obs,1890obs,2565obs like that i need 100
obs in random order? how can we create this one?
Answer Posted / sasuser
Hi Guys,
I slightly modified Dilip's answer.
I took Sashelp.shoes as the input dataset.
Following is the solution.
data A;
do i=1 to 100;
k=int(51*ranuni(2)+1);
do slice = K;
set sashelp.shoes point=slice;
output;
end;
end;
stop;
drop i k;
run;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is program data vector (pdv) and what are its functions?
What is the difference between one to one merge and match merge? Give an example.
How would you define the end of a macro?
what are the categories that sas informats are used to the place the data? : Sas-administrator
What is maximum number of rows and cols can be handled in SAS?
What is program data vector (pdv)?
What is the work of tranwrd function?
what are the best practices to process the large data sets in sas programming? : Sas-administrator
What is the difference between %put and symbolgen? : sas-macro
do you need to know if there are any missing values? : Sas programming
Describe the function and utility of the most difficult SAS macro that you have written?
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
What are the ways in which macro variables can be created in sas programming?
How to create list output for cross-tabulations in proc freq?
What is proc sort?