1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-11 06:24:35 +00:00

fix: preventing error when mp_applyformats has no formats to apply

This commit is contained in:
munja
2021-12-29 12:19:34 +00:00
parent c75c169b80
commit 0361ca574d
2 changed files with 4 additions and 4 deletions

View File

@@ -2478,16 +2478,16 @@ run;
proc sql noprint; proc sql noprint;
select distinct lib into: liblist separated by ' ' from &inds; select distinct lib into: liblist separated by ' ' from &inds;
%put &=liblist; %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 lib=%scan(&liblist,1);
%let engine=%mf_getengine(&lib); %let engine=%mf_getengine(&lib);
%if &engine ne V9 and &engine ne BASE %then %do; %if &engine ne V9 and &engine ne BASE %then %do;
%let msg=&lib has &engine engine - formats cannot be applied; %let msg=&lib has &engine engine - formats cannot be applied;
proc sql;
insert into &outds set lib="&lib",ds="_all_",var="_all", msg="&msg" ; insert into &outds set lib="&lib",ds="_all_",var="_all", msg="&msg" ;
%if &errds=0 %then %put %str(ERR)OR: &msg; %if &errds=0 %then %put %str(ERR)OR: &msg;
%end; %end;
%end; %end;
quit;
%if %mf_nobs(&outds)>0 %then %return; %if %mf_nobs(&outds)>0 %then %return;

View File

@@ -142,16 +142,16 @@ run;
proc sql noprint; proc sql noprint;
select distinct lib into: liblist separated by ' ' from &inds; select distinct lib into: liblist separated by ' ' from &inds;
%put &=liblist; %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 lib=%scan(&liblist,1);
%let engine=%mf_getengine(&lib); %let engine=%mf_getengine(&lib);
%if &engine ne V9 and &engine ne BASE %then %do; %if &engine ne V9 and &engine ne BASE %then %do;
%let msg=&lib has &engine engine - formats cannot be applied; %let msg=&lib has &engine engine - formats cannot be applied;
proc sql;
insert into &outds set lib="&lib",ds="_all_",var="_all", msg="&msg" ; insert into &outds set lib="&lib",ds="_all_",var="_all", msg="&msg" ;
%if &errds=0 %then %put %str(ERR)OR: &msg; %if &errds=0 %then %put %str(ERR)OR: &msg;
%end; %end;
%end; %end;
quit;
%if %mf_nobs(&outds)>0 %then %return; %if %mf_nobs(&outds)>0 %then %return;