Loading...
Searching...
No Matches
mpe_runhook.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Runs a hook from MPE_TABLES
4 @details Takes a hook script, identifies whether it is a
5 SAS Program or Logical Job / STP and executes the corresponding
6 code.
7
8 <h4> SAS Macros </h4>
9 @li dc_getservicecode.sas
10 @li mf_getapploc.sas
11 @li mp_include.sas
12
13 @author 4GL Apps Ltd
14 @copyright 4GL Apps Ltd. This code may only be used within Data Controller
15 and may not be re-distributed or re-sold without the express permission of
16 4GL Apps Ltd.
17**/
18
19
20%macro mpe_runhook(hookvar);
21%local pgmloc pgmtype;
22%let pgmtype=0;
23%put &sysmacroname: &=hookvar;
24%if %length(&&&hookvar)>0 %then %do;
25 %put &sysmacroname: Executing &&&hookvar;
26 data _null_;
27 rule_value=symget("&hookvar");
28 if scan(upcase(rule_value),-1,'.')='SAS' then do;
29 call symputx('pgmtype','PGM');
30 call symputx('pgmloc',rule_value);
31 end;
32 else do;
33 apploc="%mf_getapploc()";
34 if substr(rule_value,1,1) ne '/'
35 then rule_value=cats(apploc,'/',rule_value);
36 call symputx('pgmloc',rule_value);
37 call symputx('pgmtype','JOB');
38 end;
39 run;
40
41 %if &pgmtype=PGM %then %do;
42 filename sascode "&pgmloc";
43 %end;
44 %else %do;
45 %dc_getservicecode(loc=&pgmloc
46 ,outref=sascode
47 )
48 %end;
49
50 /* the below script will need to modify work.STAGING_DS */
51 %local x; %let x=; /* legacy feature */
52 %mp_include(sascode)
53
54%end;
55
56%mend mpe_runhook;