Use the CUSUM function to get the indexes into a long vector that has sum(b) elements. Loop over the categories and use the REPEAT functions to fill up the vector:
proc iml;
a = {2 3 5};
b = {1 2 3};
cumFreq = 0 || cusum(b);
N = ncol(a);
v = j(sum(b), 1);
do i = 1 to N;
bIdx = 1 + cumFreq; /* begin index */
eIdx = cumFreq[i+1]; /* end index */
print i bIdx eIdx;
v[bIdx:eIdx] = repeat(a, b);
end;
print v;