feat: adding DC_MAXOBS_WEBVIEW config item, closes #258 #259

Merged
allan merged 1 commits from issue258 into issue-251 2026-07-10 11:52:25 +00:00
2 changed files with 35 additions and 7 deletions
@@ -0,0 +1,23 @@
/**
@file
@brief migration script to move to v7.9 of Data Controller
OPTIONAL CHANGE - upload additional validation rules in dropdown (data only)
**/
%let dclib=YOURDCLIB;
libname &dclib "/YOUR/DATACONTROLLER/LIBRARY/PATH";
/* add new validation rules */
proc sql noprint;
insert into &dclib..mpe_config set
tx_from=%sysfunc(datetime())
,tx_to='31DEC9999:23:59:59'dt
,var_scope="DC"
,var_name="DC_MAXOBS_WEBVIEW"
,var_value='500'
,var_active=1
,var_desc='Default rows displayed for tables in VIEW mode.';
+12 -7
View File
@@ -71,8 +71,6 @@
/* configure macvars */
%global LIBDS FILTER_RK SEARCHVAL SEARCHTYPE FMT_IND;
%let maxrows=250;
/* avoid code injection */
%let FMT_IND=0;
%let SEARCHTYPE=;
@@ -173,6 +171,13 @@ run;
%global dsobs;
%let dsobs=0;
%macro x();
%if not %symexist(DC_MAXOBS_WEBVIEW) %then %do;
%put NOTE:;%put NOTE- DC_MAXOBS_WEBVIEW not found!;
%put NOTE- Please add to &mpelib..MPE_CONFIG table;
%put NOTE-;%put NOTE-;
%global DC_MAXOBS_WEBVIEW;
%let DC_MAXOBS_WEBVIEW=500;
%end;
%if &existds>0 %then %do;
%if &fmt_ind=1 %then %do;
@@ -234,7 +239,7 @@ run;
data work.viewdata;
set &libds;
where %inc filtref;;
if _n_>&maxrows then stop;
if _n_>&DC_MAXOBS_WEBVIEW then stop;
run;
%if %mf_nobs(work.viewdata)=0 %then %do;
data work.viewdata;
@@ -253,21 +258,21 @@ run;
%mp_searchdata(lib=work
,ds=vwsearch
,string=%superq(searchval)
,outobs=&maxrows
,outobs=&DC_MAXOBS_WEBVIEW
)
%end;
%else %if %upcase(&searchtype)=NUM %then %do;
%mp_searchdata(lib=work
,ds=vwsearch
,numval=%superq(searchval)
,outobs=&maxrows
,outobs=&DC_MAXOBS_WEBVIEW
)
%end;
%if %mf_existds(libds=MPSEARCH.vwsearch) %then %do;
%let dsobs=%mf_nobs(MPSEARCH.vwsearch);
data viewdata;
set MPSEARCH.vwsearch;
if _n_<&maxrows;
if _n_<&DC_MAXOBS_WEBVIEW;
run;
%end;
%else %do;
@@ -347,7 +352,7 @@ data work.sasparams;
PK_FIELDS=symget('PK_FIELDS');
nobs=&dsobs;
vars=%mf_getvarcount(viewdata);
maxrows=&maxrows;
maxrows=&DC_MAXOBS_WEBVIEW;
run;
%mp_abort(iftrue= (&syscc ne 0)