How to write Randomization Program
Thank you
Sathwik
Have a look at proc surveyselect if you want to select observations randomly. If you have something else in mind, post more details of the task you have to solve.
When you post a new message the table show above is displayed. Please read the checklist and provide what is missing.
data x;
input EMP_ID 9-12 NAME $ 17-30 DEPARTMENT $ 33-35 DESIGNEE $41-55;
datalines;
101 abc CL Manager
102 xyz BR Manager
103 hrx PB Manager
104 gt QA Manager
105 asd HR Manager
106 klm FD Manager
107 jrs CL Manager
108 gk CL Asst.Manager
109 krk CL Asst.Manager
110 zip BR Asst.Manager
111 qmo QA Asst.Manager
112 srk CL Associate
113 mkp CL Associate
114 rzo CL Sr.Associate
115 sec CL Sr.Associate
116 ns BR Sr.Associate
117 bza QA Sr.Associate
118 pko CL Jr.Associate
119 amp CL Jr.Associate
120 mr CL Jr.Associate
121 dr CL Jr.Associate
122 kump PB Jr.Associate
123 pn QA Jr.Associate
124 bj CL Trinee
125 bt CL Trinee
126 mc CL Trinee
127 ab BR Trinee
128 Sa BR Trinee
129 ya BR Trinee
130 vya BR Trinee
131 eek QA Trinee
;
run;
proc print data = x;
run;
How to make randomization for this program
Please don't double-post questions.We are willing to help, but you have to explain what you need.
First post regarding the same problem: https://communities.sas.com/t5/SAS-Programming/How-to-write-Randomization-Program/m-p/495582
Randomize what?
What do you mean by randomization?
The list goes on and on and on....so you need to provide significantly more details.
Vague unspecific questions will get a vague unspecific answer such as use PROC SURVEYSELECT or the RAND function.
If you need some more detailed instructions on how to ask a good question please read this post:
https://stackoverflow.com/help/how-to-ask
Please avoid putting data indented from the left hand side, as mentioned on several occasions before. SAS reads directly from position 1, hence you do not need indetations or positional reads!!
I refer you to my post:
Consult the How to post a question, found just under the post button. Provide some information.
At a guess you can use the:
Rand() function: https://blogs.sas.com/content/iml/2011/08/24/how-to-generate-random-numbers-in-sas.html
Or
Surveyselect: https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#surveyselect_toc.h...
Consult the How to post a question, found just under the post button. Provide some information.
At a guess you can use the:
Rand() function: https://blogs.sas.com/content/iml/2011/08/24/how-to-generate-random-numbers-in-sas.html
Or
Surveyselect: https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#surveyselect_toc.h...
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.