I have to use one parameter to store the following information: n variables, each variable can take Sn values. I have a toy example, 3 variables and each of them can take 1 or 2. The desired outcome should be like this:
Code: Select all
1 1 1
1 1 2
1 2 1
1 2 2
2 1 1
2 1 2
2 2 1
2 2 2
Code: Select all
Set
s /1*8/
s1 /1*2/
s2 /1*2/
s3 /1*2/
j /1*3/
Parameter a(j,s1,s2,s3)
loop(s1,
a('1',s1,s2,s3) = ord(s1);
);
loop(s2,
a('2',s1,s2,s3) = ord(s2);
);
loop(s3,
a('3',s1,s2,s3) = ord(s3);
);
display a;
Code: Select all
Parameter a(j, s)
j1 j2 j3
s1 1 1 1
s2 1 1 2
s3 1 2 1
s4 1 2 2
s5 2 1 1
s6 2 1 2
s7 2 2 1
s8 2 2 2
Best,
Gabriel