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
Are you involved in writing the inferential analysis plan? Tables specfications?
Explain what is the use of proc gplot?
What are the difference between the sas data step and sas procs?
Tell e how how dealt with..
What is the maximum and minimum length of macro variable
What is the role of administrative users? : sas-grid-administration
In SAS explain which statement does not perform automatic conversions in comparisons?
Can you execute a macro within a macro? Describe. : sas-macro
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
What is the basic structure of the SAS base program?
What is a put statement?
Differences between where and if statement?
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
How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas?
Explain the difference between informat and format with an example.