0

I have a table named as report, and there is a variable called ord which takes values 1,2,3...15. I have generated global macro variables &n1, &n2, &n3.... &n15 which are all numeric.

I wish to add another column value into the table report, which takes value of corresponding macro variables.

For example, %SYSEVALF(&n1) = 10, %SYSEVALF(&n13) = 22 , %SYSEVALF(&n10) = 8

id ord value 1 1 10 2 13 22 3 10 8 ....

I know there are many ways to solve it, however, I want to accopmlish it through just a few lines of code.

Thank you!

Honglei
  • 1
  • 1

1 Answers1

2

Use the SYMGETN() function.

value = symgetn(cats('n',ord));
Tom
  • 47,574
  • 2
  • 16
  • 29