1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-06 09:00:06 +00:00

feat: new mcf_init.sas macro to handle function compilation tracking (and associated test). Further updates to support mp_stackdiffs test results so far

This commit is contained in:
munja
2022-01-24 23:29:43 +01:00
parent 81a17bc0c2
commit 6224844915
14 changed files with 205 additions and 39 deletions

44
fcmp/mcf_init.sas Normal file
View File

@@ -0,0 +1,44 @@
/**
@file
@brief Sets up the mcf_xx functions
@details
There is no (efficient) way to determine if an mcf_xx macro has already been
invoked. So, we make use of a global macro variable list to keep track.
Usage:
%mcf_init(MCF_LENGTH)
Returns:
> 1 (if already initialised) else 0
@param [in] func The function to be initialised
<h4> Related Macros </h4>
@li mcf_init.test.sas
**/
%macro mcf_init(func
)/*/STORE SOURCE*/;
%if not (%symexist(SASJS_PREFIX)) %then %do;
%global SASJS_PREFIX;
%let SASJS_PREFIX=SASJS;
%end;
%let func=%upcase(&func);
/* the / character is just a seperator */
%global &sasjs_prefix._FUNCTIONS;
%if %index(&&&sasjs_prefix._FUNCTIONS,&func/)>0 %then %do;
1
%return;
%end;
%else %do;
%let &sasjs_prefix._FUNCTIONS=&&&sasjs_prefix._FUNCTIONS &func/;
0
%end;
%mend mcf_init;

View File

@@ -40,10 +40,11 @@
Uses a 3 part format: libref.catalog.package
<h4> SAS Macros </h4>
@li mf_existfunction.sas
@li mcf_init.sas
<h4> Related Macros </h4>
<h4> Related Programs </h4>
@li mcf_length.test.sas
@li mp_init.sas
**/
@@ -54,7 +55,7 @@
,pkg=UTILS
)/*/STORE SOURCE*/;
%if %mf_existfunction(mcf_length)=1 %then %return;
%if %mcf_init(mcf_length)=1 %then %return;
%if &wrap=YES %then %do;
proc fcmp outlib=&lib..&cat..&pkg;

View File

@@ -55,7 +55,11 @@
Uses a 3 part format: libref.catalog.package
<h4> SAS Macros </h4>
@li mf_existfunction.sas
@li mcf_init.sas
<h4> Related Programs </h4>
@li mcf_stpsrv_header.test.sas
@li mp_init.sas
**/
@@ -66,7 +70,7 @@
,pkg=UTILS
)/*/STORE SOURCE*/;
%if %mf_existfunction(stpsrv_header)=1 %then %return;
%if %mcf_init(stpsrv_header)=1 %then %return;
%if &wrap=YES %then %do;
proc fcmp outlib=&lib..&cat..&pkg;

View File

@@ -40,7 +40,11 @@
Uses a 3 part format: libref.catalog.package
<h4> SAS Macros </h4>
@li mf_existfunction.sas
@li mcf_init.sas
<h4> Related Programs </h4>
@li mcf_stpsrv_header.test.sas
@li mp_init.sas
**/
@@ -51,7 +55,7 @@
,pkg=UTILS
)/*/STORE SOURCE*/;
%if %mf_existfunction(mcf_string2file)=1 %then %return;
%if %mcf_init(mcf_string2file)=1 %then %return;
%if &wrap=YES %then %do;
proc fcmp outlib=&lib..&cat..&pkg;