由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - proc iml help!
相关主题
一个常见的问题Need advice on SAS macro debugging
一个关于macro的问题,多谢。SAS Macro 问题请教 。。。
a question about SAS请教一个SAS Macro问题。谢谢
How to the macro regression with if?a sas adv question
一道ADV 130 题目请帮忙看3道SAS题。
SAS ADVANCED 一道题求助请教:sas 循环
question about using sas macro variable and do loopsas question
问一些sas的问题In SAS , How to call a macro thousands of times?
相关话题的讨论汇总
话题: iml话题: proc话题: _&话题: end话题: macro
进入Statistics版参与讨论
1 (共1页)
t*********l
发帖数: 778
1
proc iml;
x = j(100,100,0);
do i = 1 to 100;
do j=1 to 100;
x[i,j] = n_&i._&j;
end;
end;
quit;
为什么这个不work呢?
s****e
发帖数: 1180
2
I am wondering why you put "&" before i, j in x[i,j] = n_&i._&j. If it is
for macro, then you need to put "%" before "do" both for "i" loop and "j"
loop.
Good Luck!

【在 t*********l 的大作中提到】
: proc iml;
: x = j(100,100,0);
: do i = 1 to 100;
: do j=1 to 100;
: x[i,j] = n_&i._&j;
: end;
: end;
: quit;
: 为什么这个不work呢?

t*********l
发帖数: 778
3
STILL NOT WOKRING!! n_i_j is macro variables i=1-3 j=1-3
proc iml;
x = j(3,3,0);
%macro call;
%do i = 1 %to 3;
%do j=1 %to 3;
x[i,j] = &&n_&i._&j;
%end;
%end;
%mend;
%call;
quit;
s****e
发帖数: 1180
4
I think proc iml should be inside %macro call, like the following:
%macro call;
proc iml;
x = j(3,3,0);
%do i = 1 %to 3;
%do j=1 %to 3;
x[i,j] = &&n_&i._&j;
%end;
%end;
quit;
%mend;
%call;
I once did it. Good Luck!

【在 t*********l 的大作中提到】
: STILL NOT WOKRING!! n_i_j is macro variables i=1-3 j=1-3
: proc iml;
: x = j(3,3,0);
: %macro call;
: %do i = 1 %to 3;
: %do j=1 %to 3;
: x[i,j] = &&n_&i._&j;
: %end;
: %end;
: %mend;

s****e
发帖数: 1180
5
Maybe, I did not understand you. Anyway. Good Luck!

【在 s****e 的大作中提到】
: I think proc iml should be inside %macro call, like the following:
: %macro call;
: proc iml;
: x = j(3,3,0);
: %do i = 1 %to 3;
: %do j=1 %to 3;
: x[i,j] = &&n_&i._&j;
: %end;
: %end;
: quit;

s****e
发帖数: 1180
6
I think that as macro variables, at least, it should be x[&i,&j] = &&n_&i._&
j. Good Luck!

【在 t*********l 的大作中提到】
: STILL NOT WOKRING!! n_i_j is macro variables i=1-3 j=1-3
: proc iml;
: x = j(3,3,0);
: %macro call;
: %do i = 1 %to 3;
: %do j=1 %to 3;
: x[i,j] = &&n_&i._&j;
: %end;
: %end;
: %mend;

1 (共1页)
进入Statistics版参与讨论
相关主题
In SAS , How to call a macro thousands of times?一道ADV 130 题目
SAS helpSAS ADVANCED 一道题求助
macro variable 的问题question about using sas macro variable and do loop
how to make this macro work, thanks问一些sas的问题
一个常见的问题Need advice on SAS macro debugging
一个关于macro的问题,多谢。SAS Macro 问题请教 。。。
a question about SAS请教一个SAS Macro问题。谢谢
How to the macro regression with if?a sas adv question
相关话题的讨论汇总
话题: iml话题: proc话题: _&话题: end话题: macro