SAS宏变量变化 [英] SAS macro variable change

查看:40
本文介绍了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 the arraytwo needs to take dimension 4... ?

推荐答案

改为

<代码>数组 arraytwo[%EVAL(&ARG + 1)] ;

这篇关于SAS宏变量变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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