In reply to Joseph Hirschberg.

For discussion and examples, see "Simulate categorical data in SAS":

proc iml;
call randseed(8957553);
prob = (1/5)||j(1,4,(5/40))||j(1,5,(2/50))||j(1,18,(1/180)) ;
rt = j(10,1);
call randgen(rt, "Table", prob);
print rt;