Alright I apologize ahead of time for my lack of expertise here but if anyone can help me with this I need a very BASIC explanation, I have barely ever used this syntax before.

I have a table that ends up looking like this:

A | 3 |

B | 0 |

C | 2 |

D |
1 |

I need to create as many variables as the maximum value in the second column (which here is 3, but this can change), and I'm computing number with one of the random number generator, and I want them to populate like this:

A | 3 | x | x | x |

B | 0 | . | . | . |

C | 2 | x | x | . |

D | 1 | x | . | . |

So, the cases will compute values for as many columns as the number in column 2. In pseudo code I was thinking of doing something like this (heads up-I have no idea what of this actually applies to spss syntax):

A=MAX(column2)

While A >0

(If column2 >0 (Compute Var01=gamma(1000,50))

A - 1

column2 - 1)

I have no idea if this logic even works, but if it does I already foresee the need to have the Compute Var01 part to change each time the loop goes through or it's just going to replace the variable. ANY help would be so appreciated.