1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-16 04:50:05 +00:00

fix: warning in mp_assertcolvals from outobs sql option

This commit is contained in:
Allan Bowe
2021-09-27 12:30:28 +01:00
parent 52dfa7b8f7
commit d72ca7cb24
2 changed files with 32 additions and 6 deletions

19
all.sas
View File

@@ -2188,6 +2188,7 @@ Usage:
<h4> SAS Macros </h4> <h4> SAS Macros </h4>
@li mf_existds.sas @li mf_existds.sas
@li mf_getuniquename.sas
@li mf_nobs.sas @li mf_nobs.sas
@li mp_abort.sas @li mp_abort.sas
@@ -2273,13 +2274,25 @@ Usage:
select count(*) into: orig from &lib..&ds; select count(*) into: orig from &lib..&ds;
quit; quit;
%local notfound; %local notfound tmp1 tmp2;
proc sql outobs=10 noprint; %let tmp1=%mf_getuniquename();
select distinct &col into: notfound separated by ' ' %let tmp2=%mf_getuniquename();
/* this is a bit convoluted - but using sql outobs=10 throws warnings */
proc sql noprint;
create view &tmp1 as
select distinct &col
from &lib..&ds from &lib..&ds
where &col not in ( where &col not in (
select &ccol from &clib..&cds select &ccol from &clib..&cds
); );
data &tmp2;
set &tmp1;
if _n_>10 then stop;
run;
proc sql;
select distinct &col into: notfound separated by ' ' from &tmp2;
%mp_abort(iftrue= (&syscc ne 0) %mp_abort(iftrue= (&syscc ne 0)
,mac=&sysmacroname ,mac=&sysmacroname

View File

@@ -30,6 +30,7 @@
<h4> SAS Macros </h4> <h4> SAS Macros </h4>
@li mf_existds.sas @li mf_existds.sas
@li mf_getuniquename.sas
@li mf_nobs.sas @li mf_nobs.sas
@li mp_abort.sas @li mp_abort.sas
@@ -115,13 +116,25 @@
select count(*) into: orig from &lib..&ds; select count(*) into: orig from &lib..&ds;
quit; quit;
%local notfound; %local notfound tmp1 tmp2;
proc sql outobs=10 noprint; %let tmp1=%mf_getuniquename();
select distinct &col into: notfound separated by ' ' %let tmp2=%mf_getuniquename();
/* this is a bit convoluted - but using sql outobs=10 throws warnings */
proc sql noprint;
create view &tmp1 as
select distinct &col
from &lib..&ds from &lib..&ds
where &col not in ( where &col not in (
select &ccol from &clib..&cds select &ccol from &clib..&cds
); );
data &tmp2;
set &tmp1;
if _n_>10 then stop;
run;
proc sql;
select distinct &col into: notfound separated by ' ' from &tmp2;
%mp_abort(iftrue= (&syscc ne 0) %mp_abort(iftrue= (&syscc ne 0)
,mac=&sysmacroname ,mac=&sysmacroname