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