/******************************************************************************
 * Programme : Compilation des fonctions de la toolbox
 * Reference : COMPILC279
 * Source    : https://www.wearecas.eu/en/sampleCode/COMPILC279
 ******************************************************************************/

/* --- BLOC 1 --- */
%macro run_functs_compilation(
   sas_path = _NONE_ 
 , cmp_path = _NONE_ 
 , cmp_lib  = _NONE_ 
 , prefix   = %str() 
 , contains = %str() 
 , print    = Y 
 , sendmail = N 
 , mailaddr = %str() 
 , debug    = N 
   );

   %* If debug mode, start macro trace: ;
   %if %upcase(&debug.) eq Y %then %do;
      %m_utl_print_mtrace(start)
   %end;

   options fullstimer;

   %m_adm_compile_functs(
      indir    = &sas_path. 
    , outdir   = &cmp_path. 
    , outlib   = &cmp_lib. 
    , prefix   = &prefix. 
    , contains = &contains. 
    , print    = &print. 
    , sendmail = &sendmail. 
    , mailaddr = &mailaddr. 
    , debug    = &debug. 
      );

   options nofullstimer;

   %put _global_;

   %* If debug mode, finish macro trace: ;
   %if %upcase(&debug.) eq Y %then %do;
      %m_utl_print_mtrace(end)
   %end;

%mend run_functs_compilation;

/* --- BLOC 2 --- */
%run_functs_compilation(
   sas_path = &APPL_FUNC. 
 , cmp_path = &APPL_MCAT. 
 , cmp_lib  = WORK.functs.demo
 , prefix   = %str(f_) 
 , sendmail = N
 , mailaddr = %str(pact @hermes.local)
 , debug    = N
   );

