在导出文件期间检测到打开代码语句递归 [英] Open code statement recursion detected during exporting a file

查看:24
本文介绍了在导出文件期间检测到打开代码语句递归的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 SAS 中导出文件,但我得到检测到打开代码语句递归".错误.由于我根据日期导出多个文件,因此我根据提示日期定义为宏变量,因此我想将我的文件命名为使用此变量导出,但它不起作用.如果有人帮助我,我将不胜感激.

I try to export a file in SAS but I get "Open code statement recursion detected." error. Since I export more than one files depending on date I define as a macro variable based on the prompt date, I want to name my file to be exported with this variable but it does not work. I would really appreciate if anyone helps me.

rep_date = 30APR2015:00:00:00
 Outfile = work.A042015.sas7

%let var = CATS("A",MONTH(DATEPART(&rep_date)),YEAR(DATEPART(&rep_date)));
data WORK.&var(compress=yes); 
set WORK.have;
run; 

推荐答案

宏变量只是字符串.所以如果你想在宏代码中执行函数,你需要将函数包装在 %SYSFUNC() 宏函数中.

Macro variables are just strings. So if you want to execute functions in macro code you need to wrap the function inside of the %SYSFUNC() macro function.

%let rep_date='01JAN2015:01:23'dt ;
%let dsname = A%sysfunc(datepart(&rep_date),monyy6);
data &dsname(compress=yes);
  set have;
run;

这篇关于在导出文件期间检测到打开代码语句递归的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆