I wonder in which cases related to first, last, lag, dif... operations I do need to run the data step in single mode to get the right results.
Whether I comment or not the single thread option the resulting table is correct.
Does it depend on the size of the table if cas runs in multimode?
data CASUSER.TESTA_DUP2;
/* / SESSREF='mysession' single=yes; */
set PUBLIC.WET_PX10_MAN_NOM_SL;
by timestamp sample_id;
if first.timestamp then _position_ = 0;
_position_+1;
run;
proc cas;
source MPG_toyota;
create table CASUSER.TESTA_DUP2{options replace=true} as
select a.*, _frequency_
from CASUSER.TESTA_DUP2 a left join
(select timestamp, max(_position_) as _frequency_ from CASUSER.TESTA_DUP2 group by 1) b
on a.timestamp=b.timestamp ;
endsource;
fedSQL.execDirect / query=MPG_toyota;
quit;