由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS help: 在 Macro 里循环调用 windows-display 的问题
相关主题
how to create page x of y in SASgreenhand asks a question on SAS Macro
sas macro 问题,greenhand asks a question on SAS Macro
请教这种freq 该用什么code算(sas)?Thanks!求解SAS习题,谢谢
请教 如何用macro variabe 传递数值?与Macro相关的字符函数
请教一个call symput的问题求教如何根据每一行创建一个满足条件的宏变量?非常有挑战性的问题!
SAS Macro Function请教sas问题
how to define a macro?SAS ADV passed!!!
SAS help : The scope of macro variables[合集] 一个sas问题
相关话题的讨论汇总
话题: macro话题: getdata话题: var话题: put话题: display
进入Statistics版参与讨论
1 (共1页)
p***r
发帖数: 920
1
purpose: 想要做一个macro 循环调用 display, 输出不同的 survey answer as text,
然 后再根据其内容,人工的输入yes/no,以便于以后的数据分析。
problem: 整个 macro 可以运行,唯一的问题是,display 的 window 在循环调用的时
候不能正确的显示 survey answer. (我是将所有的 survey answer 输出到一连串
macro variable 里面去)。
Any solution or suggestion in proving the code is appreciated
code is here
################################
data surveydata;
input x $40.;
cards;
This is programe is useless
I dont think so
Maybe its usefull
Not very much
;run;
%macro survey;
data _null_;
set surveydata end=eof;
call symput('var'||compress(_n_),x);
if eof then call symput('var_n',compress(_n_));
run;
%put &var1 &var2 &var3 &var_n;
%put step1;
%let mask=%bquote(&var);
****************************************
Defining the windows,This
is where the problems came. I guess*****
***************************************;
%window askit
#10 @12 "the content is &mask"
#13 @12 getdata 3 attr=underline
#16 @12 "Press ENTER to continue."
;
**************************************
Call the windows, everything seems okay.
**************************************;
%do i=1 %to &var_n;
%put var&i = &&var&i;
%let getdata=;
%display askit;
%put &i = &getdata;
%let B&i=;
%if %upcase(&getdata)=YES %then %let B&i=1;
%if %upcase(&getdata)=NO %then %let B&i=0;
%end;
%put step3;
%put B1=&B1 B2=&B2 B3=&B3 B4=&B4 N=&var_n;
%mend;
p***r
发帖数: 920
2
自己解决了,谢谢~
f*****k
发帖数: 110
3
How? Could you please show your solution so that we green hands can learn.
Thanks a lot!

【在 p***r 的大作中提到】
: 自己解决了,谢谢~
p***r
发帖数: 920
4
just put the %windows statement in the iteration, and make some adjustment.
then everything is fine. I think this has things to do with the macro
facility and the scope of macro variable.

【在 f*****k 的大作中提到】
: How? Could you please show your solution so that we green hands can learn.
: Thanks a lot!

f*****k
发帖数: 110
5
还是不懂,惭愧。

.

【在 p***r 的大作中提到】
: just put the %windows statement in the iteration, and make some adjustment.
: then everything is fine. I think this has things to do with the macro
: facility and the scope of macro variable.

1 (共1页)
进入Statistics版参与讨论
相关主题
[合集] 一个sas问题请教一个call symput的问题
靠,这个哪错了?SAS Macro Function
请帮忙看3道SAS题。how to define a macro?
[合集] sas advance questionSAS help : The scope of macro variables
how to create page x of y in SASgreenhand asks a question on SAS Macro
sas macro 问题,greenhand asks a question on SAS Macro
请教这种freq 该用什么code算(sas)?Thanks!求解SAS习题,谢谢
请教 如何用macro variabe 传递数值?与Macro相关的字符函数
相关话题的讨论汇总
话题: macro话题: getdata话题: var话题: put话题: display