You should indicate what your output would look like.
If your TranDate and TranTime are actually date and time valued SAS variables (so they will sort correctly) you can identify the Account and date that you want with (assuming sorted by account trandate trantime) then this may get you started:
data want;
set have;
by account trandate trantime;
Retain WantFlag;
if first.trandate then WantFlag =.;
if TranCode in ('sub','op') then WantFlag=1;
if Last.trandate and TranCode='cld' and WantFlag then output;
run;
... View more