本文介绍了SAS 宏变量更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一般来说,在宏内部需要修改宏变量的情况,我们如何处理;例如,假设我有这个宏:
In general how do we deal with the situation where macro variables need to be modified inside a macro; for example, suppose I have this macro:
%macro test (arg=);
array arrayone [&arg]; /* This is ok */
array arraytwo [&arg+1] /* This is not ok. How to make it work? */
...
当我想要 %test(3) 时,我们如何管理这些情况,然后arraytwo 需要采用维度 4...?
How do we manage these situation when I want %test(3) and then thearraytwo needs to take dimension 4... ?
推荐答案
改成
数组 arraytwo[%EVAL(&ARG + 1)] ;
这篇关于SAS 宏变量更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!