我想获取变量级别的数量以及唯一标识符输出的变量,但目前我的方法不起作用。然后我想使用唯一 ID 并关联来自 proc freq 的数字 1-num_levels。
这是我对proc freq的内容:
PROC FREQ DATA=my_data (keep=IDs) nlevels;
table all/out=out_data;
%let dim=levels;
%let IDs;
run;
然后我尝试使用宏变量,但它没有用,所以我包含了我的 proc 格式的手动版本,以便更好地了解我想要实现的目标,但希望能够让它更加自动化。
PROC FORMAT;
INVALUE INDEX
"1234" = 1
"2345" = 2
.
.
.
"8901" =25;
/*25 represents the output of the levels
variable from proc freq but I couldn't figure out how to grab that either*/
RUN;
任何帮助,将不胜感激。谢谢!