fzdream 发表于 2011-7-6 11:09 
如何赋值,让此值是这数据集的行数
You don't need that. Such information is already stored in a head file of a data set. See example below.
40 data t1;
41 n=ceil(ranuni(0)*10);
42 do i=1 to n;
43 output;
44 end;
45 keep i;
46 run;
NOTE: The data set WORK.T1 has 6 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
47
48 proc print data=t1;
49 run;
NOTE: There were 6 observations read from the data set WORK.T1.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
50
51 data _null_;
52 put nobs=;
53 stop;
54 set t1 nobs=nobs;
55 run;
nobs=6
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds