SAS Documentation
SASĀ® Solution for Stress Testing
Reference manual - version 08.2021
Loading...
Searching...
No Matches
irm_session_prepare.sas
Go to the documentation of this file.
1/* Copyright (C) 2018 SAS Institute Inc. Cary, NC, USA */
2
3/*!
4\file
5\brief The macro irm_session_prepare.sas will use the values defined inside the RUN_OPTION configuration table to prepare the SAS session
6
7\details
8As the RUN_OPTION configuration table is defined inside macrovarload.txt, the content of this table is automatically loaded inside macro variables.
9
10<b> Log verbosity </b>
11Depending on the value of the <i>LOG_LEVEL</i> macro variable, the solution applies a specific verbosity level to the node log (via the SAS OPTIONS statement)
12- LOG_LEVEL &leq; 1 -> notes
13- LOG_LEVEL = 2 -> notes source2 mprint
14- LOG_LEVEL = 3 -> notes source2 mprint symbolgen
15- LOG_LEVEL = 4 -> notes source2 mprint symbolgen mlogic
16- LOG_LEVEL &geq; 5 -> notes source2 mprint symbolgen mlogic mprintnest
17
18<b> Additional System Options </b>
19
20Aditional SAS System options can be specified via the <i>SYSTEM_OPTION</i> macro variable inside the RUN_OPTION table.
21For example, to enable data compression and detailed timing information you could set the value:
22- SYSTEM_OPTION = <i>fullstimer compress = yes</i>
23
24Additionally this macro will create a macro variable <i>IRM_NODE_NAME</i> containing the name of the sas program currently being executed by the IRM task.
25
26\ingroup macro utility
27\author SAS Institute Inc.
28\date 2018
29*/
30
31%macro irm_session_prepare();
32 %local
33 modate
34 fa_path
35 old_logOptions
36 ;
37
38 /* Get current MPRINT setting */
39 %let old_logOptions = %sysfunc(getoption(mprint));
40 /* Enable MPRINT */
41 option mprint;
42
43 /* Reset credentials */
44 option metauser = "" metapass = "";
45
46 /* List all libraries */
47 libname _ALL_ list;
48
49 /* Declare global macro variable IRM_NODE_NAME if it does not exist */
50 %if not %symexist(IRM_NODE_NAME) %then
51 %global irm_node_name;
52
53 /* Find out the name and FA path of the current running node */
54 %let irm_node_name = Not Available;
55 proc sql outobs = 1 nowarn noprint;
56 select
57 /* Go four levels up from the program name to get to the FA root */
58 prxchange("s/([\\\/][^\\\/]+){4}$//i", -1, xpath) as fa_path
59 /* Extract the program name */
60 , scan(xpath, -1, "/\") as node_name
61 , modate
62 into
63 :fa_path
64 , :irm_node_name
65 , :modate
66 from
67 sashelp.vextfl
68 where
69 /* Look for files */
70 directory = "no"
71 /* Programs executed via the %include statement are temporary filerefs */
72 and temporary = "yes"
73 /* Look for .sas extension */
74 and scan(xpath, -1, ".") = "sas"
75 /* Look for 'nodes' in the path */
76 and index(xpath, "nodes") > 0
77 order by
78 modate desc
79 ;
80 quit;
81
82 /* Set the RMC_FA_ID macro variable if not passed from outside through the macro varload facility (RUN_OPTION) */
83 %if(not %symexist(RMC_FA_ID)) %then
84 %let rmc_fa_id = rmc.*;
85
86 /* make sure the RMC_FA_ID is not blank */
87 %if %sysevalf(%superq(rmc_fa_id) =, boolean) %then
88 %let rmc_fa_id = rmc.*;
89
90 /* Set SASAUTOS for RMC */
91 %irm_set_fa_sasautos(fa_id = &rmc_fa_id.
92 , mode = insert
93 , insert_after = &fa_path.
94 , limit = 1
95 );
96
97 /* Set LUAPATH for RMC */
98 %irm_set_fa_luapath(fa_id = &rmc_fa_id.
99 , mode = insert
100 , insert_after = &fa_path.
101 , limit = 1
102 );
103
104 /* Restore initial MPRINT option */
105 option &old_logOptions.;
106
107 /* Set Logging options */
108 %irm_set_logging_options();
109
110 /* Set System options */
111 %irm_set_system_options();
112
113%mend;