- data n;
- length y $ 20;
- x="sex 性别 # (1=男,2=女)";
- do i=1 to 5;
- y=scan(x,i,"0123456789abcdefghigklmnopqrstuvwxyz","k");
- output;
- end;
- run;
- proc print;run;
- data n;
- length y $ 20;
- x="sex 性别 # (1=男,2=女)";
- do i=1 to 5;
- y=scan(x,i,"","kda");
- output;
- end;
- run;
- proc print;run;
sas help的说明如下:
| a or A | adds alphabetic characters to the list of characters. |
k or Kcauses all characters that are not in the list of characters to be treated as delimiters. That is, if K is specified, then characters that are in the list of characters are kept in the returned value rather than being omitted because they are delimiters. If K is not specified, then all characters that are in the list of characters are treated as delimiters.
为什么上面两个程序得出的结果不一样?




雷达卡





京公网安备 11010802022788号







