feat: new getxlmaps service to return rules for a particular xlmap_id
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 13s
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 13s
This commit is contained in:
parent
cc4535245c
commit
56264ecc69
56
sas/sasjs/services/editors/getxlmaps.sas
Normal file
56
sas/sasjs/services/editors/getxlmaps.sas
Normal file
@ -0,0 +1,56 @@
|
||||
/**
|
||||
@file getxlmaps.sas
|
||||
@brief Returns a list of rules for a specific xlmap_id
|
||||
|
||||
<h4> Service Inputs </h4>
|
||||
|
||||
<h5> getxlmaps_in </h5>
|
||||
|
||||
|XLMAP_ID|
|
||||
|---|
|
||||
|Sample|
|
||||
|
||||
<h4> Service Outputs </h4>
|
||||
|
||||
<h5> xlmaprules </h5>
|
||||
|
||||
|XLMAP_ID|XLMAP_RANGE_ID|XLMAP_SHEET|XLMAP_START|XLMAP_FINISH|
|
||||
|---|---|---|---|---|
|
||||
|Sample|Range1|Sheet1|ABSOLUTE A1| |
|
||||
|Sample|Range2|Sheet1|RELATIVE R[2]C[2]|ABSOLUTE H11|
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mp_abort.sas
|
||||
@li mpeinit.sas
|
||||
|
||||
@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.
|
||||
|
||||
**/
|
||||
|
||||
%mpeinit()
|
||||
|
||||
proc sql noprint;
|
||||
create table work.xlmaprules as
|
||||
select xlmap_id
|
||||
,XLMAP_RANGE_ID
|
||||
,XLMAP_SHEET
|
||||
,XLMAP_START
|
||||
,XLMAP_FINISH
|
||||
from &mpelib..mpe_excel_map
|
||||
where &dc_dttmtfmt. lt tx_to
|
||||
and xlmap_id in (select xlmap_id from work.getxlmaps_in)
|
||||
order by xlmap_sheet, xlmap_range_id;
|
||||
|
||||
%mp_abort(iftrue= (&syscc ne 0)
|
||||
,mac=&_program..sas
|
||||
,msg=%str(syscc=&syscc)
|
||||
)
|
||||
|
||||
%webout(OPEN)
|
||||
%webout(OBJ,xlmaprules)
|
||||
%webout(CLOSE)
|
||||
|
43
sas/sasjs/services/editors/getxlmaps.test.sas
Normal file
43
sas/sasjs/services/editors/getxlmaps.test.sas
Normal file
@ -0,0 +1,43 @@
|
||||
/**
|
||||
@file
|
||||
@brief testing getxlmaps service
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mf_getuniquefileref.sas
|
||||
@li mx_testservice.sas
|
||||
@li mp_assertdsobs.sas
|
||||
|
||||
|
||||
**/
|
||||
|
||||
%let _program=&appLoc/services/editors/getxlmaps;
|
||||
|
||||
/**
|
||||
* Test 1 - basic send
|
||||
*/
|
||||
|
||||
%let f1=%mf_getuniquefileref();
|
||||
data _null_;
|
||||
file &f1 termstr=crlf;
|
||||
put 'XLMAP_ID:$char12.';
|
||||
put "Sample";
|
||||
run;
|
||||
|
||||
%mx_testservice(&_program,
|
||||
viyacontext=&defaultcontext,
|
||||
inputfiles=&f1:getxlmaps_in,
|
||||
outlib=web1,
|
||||
mdebug=&sasjs_mdebug
|
||||
)
|
||||
|
||||
data work.xlmaprules;
|
||||
set web1.xlmaprules;
|
||||
putlog (_all_)(=);
|
||||
run;
|
||||
|
||||
%mp_assertdsobs(work.xlmaprules,
|
||||
test=ATLEAST 2,
|
||||
desc=Checking successful return of at least 2 rules for the Sample map,
|
||||
outds=work.test_results
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user