sas - SAS: Apparent symbolic reference not resolved for Macro reference
问题描述
I have understood, and seen in other programs, that the following syntax is true.
%let variable = 'something';
statement name "&variable\othertext"; // something\othertext
However, in the code I have written I get this error message: Apparent symbolic reference not resolved. for the line LIBNAME REMOTE
%let month = 'JUN';
%let year = '18';
%let zos = ***********
signon zos ********************;
libname name "*********************************";
rsubmit;
libname remote "AAAA.BBBB.&month&year.SASLIB" access = readonly;
proc download inlib=remote outlib=name;
run;
libname remote clear;
endrsubmit;
signoff;
What am I missing?
解决方案
More context would help, but most likely you are not understanding the role that period plays in resolving macro variable (symbol) references. To allow you to place letters and digits next to macro variable references SAS needs a way to tell where the name of the macro ends and the plain text starts. Period is used for that.
So if you wanted to generate this string
"AAAA.BBBB.JAN18.SASLIB"
from month and year values. First make sure to set the macro variables to the text you actually want. Quotes are just text to the macro processor.
%let month=JAN ;
%let year= 18;
Then in when you replace the values with macro variable references you will need an extra period after &YEAR so that one actually is generated. You should probably just get in the habit of always adding the period when referencing a macro variable.
"AAAA.BBBB.&month.&year..SASLIB"
推荐阅读
- verilog - 两个主组件控制同一个从设备(地址分配),英特尔 Quartus Prime Platform Designer (Qsys)
- vba - VBA Excel - 生成实数随机数,检查结果是否存在于给定范围内
- php - 在循环中替换数组中的空键
- sql - 如何在 SQL Server 中返回动态十进制数据类型?
- java - 如何使用 Glide for android 压缩和降低图像质量
- react-native - 排毒安卓“detox:compileMinReactNative44DebugJavaWithJavac”错误
- javascript - 如何将字符串货币值转换为整数
- python - 从 3d DataArray 中对特定切片的数组值进行排序
- google-analytics - 提供数百份 Google Analytics(分析)报告的最佳方式是什么?
- python - xgboost.plot_tree:二进制特征解释