由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - [SAS] call execute gives me error
相关主题
SAS base 87% pass todaybase 70 - Q27
help! SAS base 70 problem 17/35请教一道sas base题
请问一个SAS proc sql的写法请教关于char转变成numeric的问题
请教 sas base 70题 第46题sas读入数据时的一个问题请教
sas里怎么取相邻2个observation的差?macro问题诚心求教非常感谢
hi, an interview questionmacro问题诚心求教非常感谢--continue question
能不能帮忙看一下code 哪里有问题,run不出结果来[合集] SAS里如何实现LOCF(LAST OBS CARRIED FORWARD)?
[提问]怎样sort这个dataset?do loop 的一道题
相关话题的讨论汇总
话题: execute话题: call话题: run话题: data话题: cap
进入Statistics版参与讨论
1 (共1页)
D******n
发帖数: 2836
1
God ,sas is killing me....
why is the following not working?
data a1;
input a $ cap;
datalines;
5.4 0.8
;
run;
data a2;
set a1;
call execute('b = put(cap,'||strip(a)||');');
run;
proc print;run;
m*********n
发帖数: 413
2
post the log here please..
D******n
发帖数: 2836
3
NOTE: CALL EXECUTE generated line.
NOTE: Line generated by the CALL EXECUTE routine.
1 + b = put(cap,5.4);
l***a
发帖数: 12410
4
call execute has some issue reported for 9.1.3 SP4. first try to install the
hot fixes that might apply to the issue
http://support.sas.com/kb/36/070.html

【在 D******n 的大作中提到】
: God ,sas is killing me....
: why is the following not working?
: data a1;
: input a $ cap;
: datalines;
: 5.4 0.8
: ;
: run;
: data a2;
: set a1;

o****o
发帖数: 8077
5
I think it is because you put "b=put(.....,...)" in open code, wrap it with
"DATA ...." & "RUN" statement
here is what I usually do:
data _null_;
set a1 end=eof;
if _n_=1 then do; call execute('data a2;'); end;
call execute('b = put('||cap||','||strip(a)||');');
if eof then call execute('run;');
run;

【在 D******n 的大作中提到】
: God ,sas is killing me....
: why is the following not working?
: data a1;
: input a $ cap;
: datalines;
: 5.4 0.8
: ;
: run;
: data a2;
: set a1;

s*r
发帖数: 2757
6
my understanding was every bare (unquoted) string should be a variable name.
haven't used this for long time.

【在 D******n 的大作中提到】
: God ,sas is killing me....
: why is the following not working?
: data a1;
: input a $ cap;
: datalines;
: 5.4 0.8
: ;
: run;
: data a2;
: set a1;

D******n
发帖数: 2836
7
cool, it works.
what is open code?
actually what i want is
=========================
data a1;
input a $ cap;
datalines;
5.4 0.8
5.4 0.9
5.3 1.8
;
run;
data _null_;
set a1 end=eof;
if _n_=1 then do; call execute('data a2;'); end;
call execute('b = put('||cap||','||strip(a)||');output;');
if eof then call execute('run;');
run;
<----output------->
Obs b
1

【在 o****o 的大作中提到】
: I think it is because you put "b=put(.....,...)" in open code, wrap it with
: "DATA ...." & "RUN" statement
: here is what I usually do:
: data _null_;
: set a1 end=eof;
: if _n_=1 then do; call execute('data a2;'); end;
: call execute('b = put('||cap||','||strip(a)||');');
: if eof then call execute('run;');
: run;

1 (共1页)
进入Statistics版参与讨论
相关主题
do loop 的一道题sas里怎么取相邻2个observation的差?
线性回归的SAS编程疑问hi, an interview question
菜鸟请教SAS初级编程题目。能不能帮忙看一下code 哪里有问题,run不出结果来
如何用SAS对ID(OBS)求SUM或者用SAS消去ID(没有ID)。[提问]怎样sort这个dataset?
SAS base 87% pass todaybase 70 - Q27
help! SAS base 70 problem 17/35请教一道sas base题
请问一个SAS proc sql的写法请教关于char转变成numeric的问题
请教 sas base 70题 第46题sas读入数据时的一个问题请教
相关话题的讨论汇总
话题: execute话题: call话题: run话题: data话题: cap