Hi, I have written some code to update a table with various values from another table, however, SAS seems to randomly skip updating rows, even when the conditions at satisfied. I have noticed that if I restart SAS (close and re-open) the problem seems to be alleviated to some degree, but there will still missing values at times. I would say that this happens about 90% of the time I try and run the code. Furthermore, each time I run the code, (even with the same input data) the rows that don't get updated are different each time.
%if &i=1 %then %do;
proc sql feedback;
alter table l.raw_%sysfunc(date(),date7.)
add A num format best32.
add B num format best32.;
update l.raw_%sysfunc(date(),date7.) t1
set A = (select ppg_total_&rpi2._a from l.raw_%sysfunc(date(),date7.)_copy where monotonic() = &i) where monotonic() = &i;
update l.raw_%sysfunc(date(),date7.) t1
set B = (select ppg_allow_total_&rpi2._a from l.raw_%sysfunc(date(),date7.)_copy where monotonic() = &i) where monotonic() = &i;
quit;
%end;
%else %do;
proc sql;
update l.raw_%sysfunc(date(),date7.) t1
set A = (select ppg_total_&rpi2._a from l.raw_%sysfunc(date(),date7.)_copy where monotonic() = &i) where monotonic() = &i;
update l.raw_%sysfunc(date(),date7.) t1
set B = (select ppg_allow_total_&rpi2._a from l.raw_%sysfunc(date(),date7.)_copy where monotonic() = &i) where monotonic() = &i;
quit;
%end;
... View more