Multiple values for a "variable"

Under certain scenarios, I have a data set where several different people should be responsible for a situation. So, if the variable

[pre] PlayResult = 'hit'[/pre]

there can be anywhere from 1 to 4 fielders responsible for this. I would then want to have a variable, "ResponsibleFielder" be able to have whatever fielders should be responsible, in other words, i would want the variable to be able to reference multiple values, where the number of values can change from data line to data line. A 3-dimensional variable for my data set if you will.

So for example, if [pre]PlayResult = 'hit'[/pre] for the first data line, i might have [pre]ResponsibleFielder= Player1, Player2, Player3[/pre] and then for the second data line have [pre]ResponsibleFielder= Player7, Player12[/pre] and for the third dataline have [pre]ResponsibleFielder= Player14[/pre]

Re: Multiple values for a "variable"

It sounds to me like you want to build yourself a multi-dimensional array -- perhaps something like the following:
dimension 1=inning
dimension 2=at bat (seq number of at-bat in the inning)
dimension 3=batter
dimension 4=multimensional array of defensive players involved in play
dimension 5=result

That's off the top of my head. But the problem sounds as if it is soluble by building arrays. Or hash tables instead of arrays.

The first two line of data show one scenario with 2 different fielders, 0 & 5. The next 3 lines show a different scenario with 3 fielders, 0, 5 & 9. I then want it to look like this:
[pre]
z BT BBV DP Bat Res field1 field2 field3
23 5 1 N R Hit 0 5
23 5 1 Y L Hit 0 5 9
[/pre]
What do i need to do to make this work?