 %macro complsts(l1, l2);
  %*---compare 2 macro variables containing lists to see if they are in sync----;
  %local i word word2 l1done l2done;
 %let l1done=0;  %let l2done=0;
 %do i=1 %to 1000 ;
   %let word=%scan(&l1,&i);
   %If %superq(word)=%str() %then %do;
   %put **End of first list**; %let l1done=1;
   %if &l2done %then %goto endmac;
   %end;

   %let word2=%scan(&l2,&i);
   %If %superq(word2)=%str() %then %do;
   %put **End of second list**; %let l2done=1;
   %if &l1done %then %goto endmac;
   %end;
   %put &i  &word | &word2 ;
 %end; %*-- do i loop--;
 %endmac:
 %mend complsts;


 %*complsts(&pctvarsbg , &pctwtsbg);
 %*complsts(&acsmeansbg , &acsmwgtsbg);
