I have a dataset with almost more than 1000 subjects and they have subjid in the format of 303-101-120, 303-100-130, 303-103-140........ I need to scramble the subject id, i.e i need to assign a subejct id from one record to other record and so on but i should not make any modification to the subject id for example: 1,2,3,4,5 are subject id's and these need to assigned as 3,5,1,4,2. here we are not making any modification but just scrambling subject id. I am trying to use Ranuni but not sure i am not able to aceive the result. Is there any possible way i can do that in few steps as its very hectic to change that manually. i have provided a sample code for an example, i have 1000+usubjid. Any help please data ndsn;
infile datalines;
input subjid study site usubjid $15.;
datalines;
120 303 100 303-100-120
121 303 100 303-100-121
122 303 101 303-101-122
123 303 101 303-101-123
124 303 102 303-102-124
125 303 102 303-102-125
126 303 103 303-103-126
127 303 103 303-103-127
128 303 104 303-104-128
129 303 104 303-104-129
;
run;
... View more