SAS include dynamic path

江枫思渺然 提交于 2019-12-12 01:16:09

问题


I have tryed build little macro which in loop it should runother SAS programs. Table Control_files has two field, where are other part of path to proper sas program.

%LET PATH_TO = '%include "T:\XXX\YYY\ZZZ\';
%LET PATH_end = '.sas"';
data _null_;
set CONTROL_FILES;
call execute ('%runlimitsquery('||&PATH_TO||SCHEMA_NAME||'\'||PROCES_NAME||&PATH_end||');');
run;

I tryed used runlimitsquery because I found somewhere that tip.. When I run my code, log returns:

NOTE: CALL EXECUTE generated line.
NOTE: Line generated by the CALL EXECUTE routine.
1         + %runlimitsquery(%include "T:\XXX\YYY\ZZZ\XXX_TECHNICAL_AAAAA\001_AAAAA.sas");
            _
            180
WARNING: Apparent invocation of macro RUNLIMITSQUERY not resolved.

ERROR 180-322: Statement is not valid or it is used out of proper order

Anyone can help me?


回答1:


Ok, I have answer for my problem... Below code works:

%LET PATH_TO = '%include "T:\XXX\YYY\ZZZ\';
%LET PATH_end = '.sas"';
data _null_;
set CONTROL_FILES;
call execute ('('||&PATH_TO.||SCHEMA_NAME||'\'||PROCES_NAME||&PATH_end.||';');
run;


来源:https://stackoverflow.com/questions/53213087/sas-include-dynamic-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!