diff --git a/all.sas b/all.sas index 25b004e..be7b4d4 100644 --- a/all.sas +++ b/all.sas @@ -2478,16 +2478,16 @@ run; proc sql noprint; select distinct lib into: liblist separated by ' ' from &inds; %put &=liblist; -%do i=1 %to %sysfunc(countw(&liblist)); +%if %length(&liblist)>0 %then %do i=1 %to %sysfunc(countw(&liblist)); %let lib=%scan(&liblist,1); %let engine=%mf_getengine(&lib); %if &engine ne V9 and &engine ne BASE %then %do; %let msg=&lib has &engine engine - formats cannot be applied; - proc sql; insert into &outds set lib="&lib",ds="_all_",var="_all", msg="&msg" ; %if &errds=0 %then %put %str(ERR)OR: &msg; %end; %end; +quit; %if %mf_nobs(&outds)>0 %then %return; diff --git a/base/mp_applyformats.sas b/base/mp_applyformats.sas index d6b4b83..06f4964 100644 --- a/base/mp_applyformats.sas +++ b/base/mp_applyformats.sas @@ -142,16 +142,16 @@ run; proc sql noprint; select distinct lib into: liblist separated by ' ' from &inds; %put &=liblist; -%do i=1 %to %sysfunc(countw(&liblist)); +%if %length(&liblist)>0 %then %do i=1 %to %sysfunc(countw(&liblist)); %let lib=%scan(&liblist,1); %let engine=%mf_getengine(&lib); %if &engine ne V9 and &engine ne BASE %then %do; %let msg=&lib has &engine engine - formats cannot be applied; - proc sql; insert into &outds set lib="&lib",ds="_all_",var="_all", msg="&msg" ; %if &errds=0 %then %put %str(ERR)OR: &msg; %end; %end; +quit; %if %mf_nobs(&outds)>0 %then %return;