One dataset is updated by several sas programs. If the dataset is locked by another process, i use the macro %macro trylock(member=, timeout=);
%local starttime;
%let starttime = %sysfunc(datetime());
%do %until (&syslckrc = 0
or %sysevalf(%sysfunc(datetime()) > (&starttime + &timeout)));
%put trying to open ...;
%put trying lock ...;
lock &member;
%if &syslckrc ne 0 %then %let rc=%sysfunc(sleep(15));
%put syslckrc=&syslckrc;
%end;
%mend trylock; The dataset I am using is run_st_final, which is being updated by sveral programs. after calling the above macro, data _null; %put &=syslckrc; if syslckrc=0 then; proc append base=dtpth.run_st_final data=work.&dtst; run; lock dtpth.run_st_final clear; run; I am getting an error you did not lock the dataset run_st_final. My understanding is that the above macron lock the dataset so that I can append. syslckrc=0 means, I was able to lock the dataset before the next activity. My understanding is correct? How can I rectify the error with the loock run_st_final clear.. you didnot lock this dtaset.
... View more