Hi, I have tried with 'if _n_ eq', _n_ trick. Input data is with 200K records. entire data step with call execute took about 3 hours to execute. I tried differently thinking why to read all other observations from dataset within call execute since we want to execute condition only when observation number matches between both dataset. since I am reading the same dataset within call execute as well I tried with POINT= option. Execution completed in 5 mins compared to ~3 hours earlier.

below is the program section. cmd_all, cmd_lo, cmd_hi, cmd_tg are variables with sas statments to be executed.
I removed 'if _n_ eq', _n_ condition since we reading data with POINT= option.

data _null_;
set DT03 end=last;
by usubjid parcat1 parcat2 paramcd avisitn;
OBS=_n_;
if _n_=1 then
do;
call execute('data DT04;');
end;
call execute('do z='||cats(OBS)||'; set DT03 point=z;');
if not missing(cmd_all) then call execute(cmd_all);
if not missing(cmd_tg) then call execute(cmd_tg);
if not missing(cmd_lo) then call execute(cmd_lo);
if not missing(cmd_hi) then call execute(cmd_hi);
call execute('output;end;');
if last then call execute('stop;Run;');
run;