是这个意思吗?
proc sort data=a out=b;
by subj value;
run;
data _int;
set b;
by subj value;
retain n;
if index(put(value,best.),'.')>0 then n=int(value+1);
if n=value then do;flag='int';output;end;
run;
proc sql;
create table wanted as
select subj,ifn(index(put(value,best.),'.')>0,int(value),value) as value
from b
where subj in (select distinct subj from _int)
union ...
proc sort data=a out=b;
by subj value;
run;
data _int;
set b;
by subj value;
retain n;
if index(put(value,best.),'.')>0 then n=int(value+1);
if n=value then do;flag='int';output;end;
run;
proc sql;
create table wanted as
select subj,ifn(index(put(value,best.),'.')>0,int(value),value) as value
from b
where subj in (select distinct subj from _int)
union all
select subj,ifn(index(put(value,best.),'.')>0,ceil(value),value) as value
from b
where subj not in (select distinct subj from _int)
order by subj,value;
quit;