SAS中文论坛

标题: A QUESTION:HOW TO DEFINE A FUNCTION [打印本页]

作者: shiyiming    时间: 2006-6-21 21:56
标题: A QUESTION:HOW TO DEFINE A FUNCTION
for example:
*ab is a function defined by ourselves;

ab(in1,in2)
{return in1+in2;}

c=ab(1,2);
so c will be 3;
thanks.
作者: shiyiming    时间: 2006-6-22 21:36
标题: for example
data d1;
input a1 a2;
a3=ab(a1 a2);
datalines;
1 2
3 4
;
proc print data=d1;
run;
d1 will be:

1 2 3
3 4 7

My question is how to define the function ab()?

Really thanks.
作者: shiyiming    时间: 2006-6-23 15:13
标题: to NEWCOMER
一般用宏来定义“函数”。
如果一定要你这样的形式,要写SCL的。




欢迎光临 SAS中文论坛 (http://mysas.net/forum/) Powered by Discuz! X3.2