想知道如何在 SAS 宏中实现 %input 吗?

Wanna know how to implement %input in SAS Macros?

谁能帮我在 SAS 中使用 %input 宏语句。我通过谷歌搜索知道 %input 是用于创建宏变量的宏语句。

%INPUT 只应在遗留情况下使用。

文档(如果您阅读的话)说明了使用条件。

Details

The macro processor interprets the line submitted immediately after a %INPUT statement as the response to the %INPUT statement. That line can be part of an interactive line mode session, or it can be submitted from within the Program Editor window during a windowing environment session.

这意味着您正在从控制台输入值或在 程序编辑器 中提交代码。从默认增强编辑器或 SAS 服务器提交时,%INPUT 将导致错误。

节目编辑

%symdel a b c;

%input a b c;
123 456 pqr

%put NOTE: &=a &=b &=c;
--- LOG ---;
30   %input a b c;
31
32   %put NOTE: &=a &=b &=c;
NOTE: A=123 B=456 C=pqr

增强编辑器

%symdel a b c;

%input a b c;
123 456 pqr

%put NOTE: &=a &=b &=c;
--- LOG ---;
34   %input a b c;
35   123 456 pqr
     ---
     180
ERROR 180-322: Statement is not valid or it is used out of proper order.

36
37   %put NOTE: &=a &=b &=c;
NOTE: A= B= C=