Loading...
Searching...
No Matches
mpeterm.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Termination file for the 4GL Apps Editor
4 @details
5 enables tracking and performance logging
6
7 <h4> SAS Macros </h4>
8 @li mp_abort.sas
9 @li mf_getplatform.sas
10
11 @version 9.4
12 @author 4GL Apps Ltd
13 @copyright 4GL Apps Ltd. This code may only be used within Data Controller
14 and may not be re-distributed or re-sold without the express permission of
15 4GL Apps Ltd.
16**/
17
18
19%macro mpeterm();
20
21%local oldloc;
22data _null_;
23 if symexist('SYSPRINTTOLOG') then oldloc=symget('SYSPRINTTOLOG');
24 else oldloc=getoption('LOG');
25 if subpad(oldloc,1,1) not in ('"',"'",' ') then oldloc=quote(cats(oldloc));
26 call symputx('oldloc',oldloc,'l');
27run;
28
29%if %length(&oldloc)>0 %then %do;
30 proc printto log=log;
31 run;
32 data _null_;
33 infile &oldloc;
34 input; putlog _infile_;
35 run;
36%end;
37%if %sysfunc(exist(&dc_libref..mpe_requests)) and %mf_getplatform() ne SASVIYA
38and &DC_REQUEST_LOGS ne NO
39%then %do;
40 data ;
41 if 0 then set &dc_libref..mpe_requests;
42 request_dttm=%sysfunc(datetime());
43 request_user="%mf_getuser()";
44 request_service="%scan(&_program,-2,/)/%scan(&_program,-1,/)";
45 request_params='';
46 /* sleep random amount to avoid parallel update attempts */
47 call sleep(ranuni(0)*0.1,1);
48 output;stop;
49 proc append base=&dc_libref..mpe_requests data=&syslast force nowarn;
50 run;
51%end;
52
53%mend mpeterm;