Hello Tom, i can not get the right result with your codes. I have SAS 9.1 TS1M3 on Win 7 Pro 64bit. 387 proc sql ; 388 create table count as 389 select count(distinct name) as count,'comment' as comment 390 from sashelp.class where age > 100 391 ; NOTE: Table WORK.COUNT created, with 1 rows and 2 columns. 392 quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 393 data _null_; 394 set count; 395 put (_all_) (=); 396 run; count=0 comment= NOTE: There were 1 observations read from the data set WORK.COUNT. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds It seems that the results really depend on how SAS works. I think that the functions in Proc SQL have an initial value, such as the function count has "0" and sum has ".". the columns like comment with no function maybe has a initial value "blank". so at the beginning when SAS initial the table T1, there is already one observation and the column count has a value 0 and the column comment has nothing. then the real value will be generated by the codes. under the condition "x > 5" returns no observation for caculation and the initial value will no changed. In the normal data and proc step SAS use an other Method for caculation. for example, use proc summsary with where condition to caculate the table T. if there is no observation, there will be also no observation in the results.
... View more