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 are sas/access and sas/connect? : Sas programming
Differentiate between format and informat? : sas-grid-administration
I have a dataset concat having variable a b & c. How to rename a b to e & f?
What areas of SAS are you most interested in?
What is the use of the %include statement?
What is the difference between reading data from an external file and reading data from an existing data set?
What are the statements in proc sql?
What commands are used in the case of including or excluding any specific variables in the data set?
explain the use of % includes a statement in sas? : Sas-administrator
What is factor analysis?
What would you change about your job?
How will you generate test data with no input data?
what is sas business intelligence? : Sas-bi
Mention sas system options to debug sas macros.
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;