2
此代码给出错误“期望整数常量”。为什么?这很简单,我找不到任何说in()不能用小数的东西。我需要在某个地方“做”吗?谢谢。IN函数不能使用小数点
data clustered;
set combd;
if (avpm in(393821:450041) or avpm in(337601:393821) or avpm in
(225161:281381)) and fsp in (.8768:1) then class='1';
if (avpm in(112720:168940) or avpm in(56500:112720) or avpm in
(280.06:56500)) and fsp in (.8768:1) then class='2';
if avpm in(280.06:56500) and (fsp in (.507:.6303) or fsp in (.3838:.507)
or fsp in (.2606:.3838)) then class='3';
if avpm in(280.06:56500) and (fsp in (.1373:.2606) or fsp in
(.0141:.1373)) then class='4';
if avpm in(280.06:56500) and fsp in (.8768:1) then class='5';
if avpm in(280.06:56500) and (fsp in (.8768:1) or fsp in (.7535:.8768) or
fsp in (.6303:.7535)) then class='6';
run;
谢谢乔;说得通。 – mbs23
in运算符使用十进制数字列表,如果它们是离散指定的,例如'如果x等于0.5,如果x in(0,0.5,1)'将为真。尽管如此,你无法真正期望SAS与无数的无限数字相匹配。 – david25272