Hi! I wonder if there is a way of using a certain value of a table as a variable name for another table. For example: I have two tables, table TBF (to be filled) and table INFO. Table TBF looks like this: B C5 C6 P1 P2 P3 B24 16 € 15 € B52 84 € 64 € B62 35 € 86 € B12 12 € 215 € B13 74 € 56 € And I have to fill P1--P3 given table INFO: P B C P1 B24 C5 P2 B52 C5 P3 B62 C5 P1 B12 C6 P2 B13 C6 So for example, when B = B24, P1 = C5, updating the table TBF as: B C5 C6 P1 P2 P3 B24 16 € 15 € 16€ B52 84 € 64 € B62 35 € 86 € B12 12 € 215 € B13 74 € 56 € So I need something like: %LET LP = P1;
TBF.&LP = (select INFO.C
where TBF.B = INFO.B and INFO.P = &LP
from INFO, TBF) But doing so, when B=B24, P1 will write "C5" instead of 16€. How can I get SAS to keep "C5" as a variable name instead of a value? The table TBF finally should be: B C5 C6 P1 P2 P3 B24 16 € 15 € 16€ . . B52 84 € 64 € . 84€ . B62 35 € 86 € . . 35€ B12 12 € 215 € 215€ . . B13 74 € 56 € . 56€ . If anything is confusing I'll be glad to clarify it! Thank you very much,
... View more