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;
|