fix: updates to demodata to enable auto CAS promote
Some checks failed
Build / Build-and-ng-test (pull_request) Successful in 3m36s
Build / Build-and-test-development (pull_request) Successful in 9m2s
Lighthouse Checks / lighthouse (24.5.0) (pull_request) Failing after 3h13m50s

This commit is contained in:
zver
2026-02-07 20:02:14 +00:00
parent 8c2aeacc85
commit 7740d2ac86
2 changed files with 56 additions and 25 deletions

View File

@@ -12,6 +12,7 @@
<h4> SAS Macros </h4>
@li mpeinit.sas
@li mf_getengine.sas
@li mf_increment.sas
@li mp_abort.sas
@li mx_createwebservice.sas
@@ -42,16 +43,7 @@ libname &demolib "%sysfunc(pathname(&dc_libref))/&demolib";
%mpeinit()
options replace;
data &demolib..cars_ext
%let engine_type=%mf_getengine(&base_lib);
%if &engine_type=CAS %then %do;
(promote=yes)
%end;
%else %do;
(index=(carspk=(make model PRODUCTIONDATE) /unique))
%end;
;
data work.cars_ext(index=(carspk=(make model PRODUCTIONDATE) /unique));
attrib
MAKE length= $13
MODEL length= $40
@@ -65,8 +57,8 @@ data &demolib..cars_ext
PRODUCTIONDATE length= 8 format=DATE9.
;
set sashelp.cars;
if mod(ceil(ranuni(1)*100),3)=0 then comment=catx(' ',make,type);
retain comment 'n/a';
if mod(ceil(ranuni(1)*100),3)=0 then notes=catx(' ',make,type);
call missing(notes);
/* random / reproducible date between 1960 and 2020 */
PRODUCTIONDATE=ceil(ranuni(1)*365*60);
@@ -89,14 +81,7 @@ data &demolib..cars_ext
*put (_all_)(=);
run;
data &demolib..COUNTRIES
%if &engine_type=CAS %then %do;
(promote=yes)
%end;
%else %do;
(index=(countriespk=(origin country) /unique))
%end;
;
data work.COUNTRIES(index=(countriespk=(origin country) /unique));
attrib
ORIGIN length= $6
COUNTRY length= $30
@@ -117,6 +102,28 @@ Asia,Korea
;;;;
run;
%let engine_type=%mf_getengine(&demolib);
%put &=engine_type;
%if &engine_type=CAS %then %do;
proc cas;
table.tableExists result=r / name="CARS_EXT" caslib="PUBLIC";
if r.exists then
table.dropTable / name="CARS_EXT" caslib="PUBLIC" quiet=TRUE;
table.tableExists result=r2 / name="COUNTRIES" caslib="PUBLIC";
if r2.exists then
table.dropTable / name="COUNTRIES" caslib="PUBLIC" quiet=TRUE;
quit;
proc casutil;
load data=work.CARS_EXT outcaslib="PUBLIC" casout="CARS_EXT" promote;
load data=work.COUNTRIES outcaslib="PUBLIC" casout="COUNTRIES" promote;
run;
%end;
%else %do;
data &demolib..CARS_EXT; set work.cars_ext;
data &demolib..COUNTRIES; set work.countries;run;
%end;
%let demolib=%upcase(&demolib);
proc sql;
delete from &dc_libref..mpe_tables
@@ -202,6 +209,33 @@ insert into &dc_libref..MPE_VALIDATIONS set
,rule_value="&demolib..CARS_EXT.POTENTIALBUY"
,rule_active=1
,tx_to='31DEC5999:23:59:59'dt;
insert into &dc_libref..MPE_VALIDATIONS set
tx_from=0
,base_lib="&demolib"
,base_ds="CARS_EXT"
,base_col="COMMENT"
,rule_type='NOTNULL'
,rule_value="n/a"
,rule_active=1
,tx_to='31DEC5999:23:59:59'dt;
insert into &dc_libref..MPE_VALIDATIONS set
tx_from=0
,base_lib="&demolib"
,base_ds="CARS_EXT"
,base_col="ENGINESIZE"
,rule_type='MINVAL'
,rule_value="1.3"
,rule_active=1
,tx_to='31DEC5999:23:59:59'dt;
insert into &dc_libref..MPE_VALIDATIONS set
tx_from=0
,base_lib="&demolib"
,base_ds="CARS_EXT"
,base_col="ENGINESIZE"
,rule_type='MAXVAL'
,rule_value="8.3"
,rule_active=1
,tx_to='31DEC5999:23:59:59'dt;
%mp_abort(iftrue= (&syscc ne 0)
,mac=&_program
,msg=%str(syscc=syscc=&syscc during param configuration)

View File

@@ -1,17 +1,14 @@
/**
@file dc_createdataset.sas
<h4> SAS Macros </h4>
@version 9.3
@author 4GL Apps Ltd
@copyright 4GL Apps Ltd. This code may only be used within Data Controller
and may not be re-distributed or re-sold without the express permission of
4GL Apps Ltd.
**/
%macro dc_createdataset(libds=mm_getlibs);
data viewdata;
%macro dc_createdataset(libds=mm_getlibs,outds=viewdata);
data &outds;
var1='Table';
var2="&libds";
var3="does not exist!";