Dynamic variable names in SAS

前端 未结 4 1020
星月不相逢
星月不相逢 2021-01-20 02:16

Is there a way in SAS to specify dynamic variable names in code? i.e. use different variables on different observations based on the value of another variable?

For

4条回答
  •  遥遥无期
    2021-01-20 02:53

    I think the simplest solution would be to use VVALUEX function. It creates the variable name using the index, and then supplies it as an argument to the function -

    var_index = vvaluex(compress("var" || put(index, 8.)));
    

提交回复
热议问题