Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前有一个基于一些内部参数生成完整报告(数据操作、分析、格式化、Excel 输出)的程序。
我想构建一个工具或宏来迭代 6 个数据集,并为每个数据集独立提供报告。
以流程方式:
输入数据 -> 程序操作 -> 报告生成输出
我需要能够即时更改输入数据集。
任何帮助将不胜感激:
仅供参考 - 我尝试过提示,但“数据源”选项不允许我选择新的数据源。
编写此类内容的一般结构是使数据源名称或连接详细信息成为宏参数。这假设您的其他步骤都是相同的(或都具有类似的参数化)。就像是
%macro run_reports(datasource=); proc freq data=&datasource.; run; %mend run_reports; %run_reports(datasource=mydata1); %run_reports(datasource=mydata2);
显然内部比这更复杂,但这是基本思想。如果有这样做的逻辑方法,您也可以以编程方式生成宏调用。