01-27-2016 04:38 PM
I am trying to figure out if there is a way to automate the process of assigning random IDs to a set of over 170K records. - is there a SAS function that do this for me? I have found some random ID creation code, but what I have found creates decimals and alphanumeric IDs and I cannot specify a specific range. I need this ID to be 20 characters long (all numeric).
Thank you for any help you can provide.
01-27-2016 05:16 PM
Yes PROC PLAN can do it
proc plan seed=0; factors id=170000 /noprint; output out=IDs; run; data yes; input x $ y$; cards; d f h i p o ; run;
data want; set IDs; set yes; run;
01-27-2016 06:26 PM - edited 01-27-2016 06:27 PM
The result may contain digits but it will not be a number as 20 digits will exceed the storage precision of SAS.
put x= best32. y= best32.;
I would consider if you have a number of fields if combined would work to concatenate them.
If this is for linkage purposes, how are you going to get the values into multiple datasets if they are random?
Need further help from the community? Please ask a new question.