In SAS, is it possible to refer a %let statement to a value located in a database?
For instance, the value of my n in %let n=50 depends on some value calculated in one of my databases, e.g., first row plus first column. And since that value gets modified 100 times in my loop I don’t want to manually enter that value.
There’s several ways to do this. Here’s two:
This populations a macro variable,
&n, with the sum of the variablesaandb. The condition you specify should be true only for one row of your table.Another approach: