Reputation: 530
I have a dataset in parameter variable
set t /t1 * t5/;
parameter mydata(t) /t1 10, t2 20, t3 30, t4 40, t5 50/;
How can I, the easiest way, get the n'th element of mydata
. I am looking for something like:
display mydata(3)
where I will get the value 30
Upvotes: 0
Views: 193
Reputation: 2292
set t /t1 * t5/;
parameter mydata(t) /t1 10, t2 20, t3 30, t4 40, t5 50/;
scalar x;
x = sum(t$(ord(t)=3), mydata(t));
display x;
Upvotes: 1