楼主: zhangkun1988
6430 13

公式用SAS计算 [推广有奖]

11
pobel 在职认证  发表于 2012-11-22 11:10:31
jingju11 发表于 2012-11-22 10:17
%SYSEVALF() is not able to resolve the functions, for example, exp(), constant('pi'), etc. Do you  ...
Try this:
  1. data raw;
  2.     input string :$20.;
  3. datalines;
  4. 1+1
  5. 2*1.2
  6. 1/3
  7. 2**2
  8. 2*(1+3)
  9. exp(2)
  10. constant('pi')
  11. ;
  12. data _null_;
  13.    set raw end=last;
  14.        length code $1000;
  15.         retain code;

  16.         if _n_=1 then code="data test; length string $"||strip(lengthm(string))||";";

  17.         code=cats(code,"string=",quote(strip(string))
  18.                   ,";number="||strip(string)
  19.                   ,"; output;");

  20.         if last then do;
  21.            code=cats(code," run;");
  22.                    call execute(code);
  23.         end;
  24. run;
复制代码
和谐拯救危机

12
sunset1986 发表于 2012-11-22 15:21:16
pobel 发表于 2012-11-22 11:10
Try this:
真心很赞
An honest tale speeds best being plainly told.
Cheers!

13
playmore 发表于 2012-11-27 15:28:41
jingju11 发表于 2012-11-22 10:17
%SYSEVALF() is not able to resolve the functions, for example, exp(), constant('pi'), etc. Do you  ...
在%SYSEVALF中遇到EXP等函数报错的话
用%SYSFUNC再包含住EXP函数
如:%SYSEVALF(1/%SYSFUNC(EXP(&a)));
在网上搜到的:
http://listserv.uga.edu/cgi-bin/ ... amp;D=0&P=28574
playmore邀请您访问ChinaTeX论坛!!!进入ChinaTeX论坛

14
jingju11 发表于 2012-11-28 01:22:47
thanks.

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-28 17:08