The SAS data set WORK.ONE contains a numeric variable named Num and a character variable named Char:
Num | Char |
1 | 23 |
2 | 23 |
1 | 77 |
The following SAS program is submitted:
proc print data=WORK.ONE;
where Num=’1′;
run;
What is output?
A.
Obs | Num | Char |
1 | 1 | 23 |
B.
Obs | Num | Char |
1 | 1 | 23 |
3 | 1 | 77 |
C.
Obs | Num | Char |
1 | 1 | 23 |
2 | 2 | 23 |
3 | 1 | 77 |
D. No output is generated.
Check Answer注解:数值型无法和字符型进行逻辑运算(例如:比大小),并且WHERE statement不会自动将字符型转换成数值型。Log中会显示”ERROR: WHERE clause operator requires compatible variables.”。