Based on your code you only want to process the last obs in your source table &LOCAL.CAMPAIGN_DATES_UNIQUE. If I understand the rest of your question correctly then code as below should do what you want.
data _null_;
call symputx('last_obs',nobs);
stop;
set &LOCAL.CAMPAIGN_DATES_UNIQUE nobs=nobs;
run;
data _null_;
set &LOCAL.CAMPAIGN_DATES_UNIQUE (firstobs=&last_obs);
array arr_V_From{*} v_From:;
array arr_V_To{*} v_To:;
do i=1 to dim(arr_V_From);
call symputx(cats('v_from_',i),arr_V_From[i] );
call symputx(cats('v_to_',i) ,arr_V_To[i] );
end;
run;
Above code also creates a macro variable &n_arr_elements that tells you how many macro variables have been created: &v_from_1 to &&v_from_1_&n_arr_elements.
Based on your description you want to use these macro variables somehow later on in a Proc SQL. If you explain and show us a bit more of your process then some improvements to your current design could be possible that would reduce complexity.
... View more