SAS Documentation
SASĀ® Solution for Stress Testing
Reference manual - version 08.2021
Loading...
Searching...
No Matches
install_create_irm_sample_data.sas
1/* Federated Area Id (as specified in SMC) */
2%let irm_fa_id = %sysget(irm_fa_id);
3/* Configuration set */
4%let config_set_id = %sysget(config_set_id);
5/* MIP workgroup */
6%let mipWorkgroup = %sysget(mipWorkgroup);
7/* Reportmart Folder Name */
8%let martFolderName = %sysget(martFolderName);
9/* Install sample data? */
10%let installSampleflg = %sysget(installSampleflg);
11
12/* Username and password used to import MIP modeling systems */
13%let sasUser = %sysget(sasUser);
14%let sasPassword = %sysget(sasPassword);
15
16/* Get the path to the FA from metadata */
17%let irm_fa_path = %sysfunc(metadata_appprop(IRM Mid-Tier Server, com.sas.solutions.risk.irm.fa.&irm_fa_id.));
18%let irm_appdata_path = %sysfunc(metadata_appprop(IRM Mid-Tier Server, com.sas.solutions.risk.irm.server.appdata));
19
20/* Extract the irm folder name and the source path */
21%let fa_name = %scan(%bquote(&irm_fa_path.), -1, /\);
22%let source_path = %sysfunc(prxchange(s/[\\\/]&fa_name.$//i, -1, %bquote(&irm_fa_path.)));
23
24/* Update the macro search path */
25option insert = (sasautos = ("&irm_fa_path./source/sas/ucmacros"));
26option mprint;
27
28/* Setup environment */
29%irm_setup(source_path = &source_path.
30 , fa_id = &fa_name.
31 );
32
33/* Retrieve the content version from the version.txt file */
34%let content_version = %irm_get_content_version(irm_fa_path = &irm_fa_path.);
35
36/* Create Reportmart folder */
37%rsk_mkdirs_and_verify(&irm_appdata_path./Reportmart/&martFolderName.);
38
39
40/* ************************************************* */
41/* Create Sample Data */
42/* ************************************************* */
43
44%if(&installSampleflg. = Y) %then %do;
45 /* Create sample data (triggering live ETL) */
46 %irm_create_sample_data(source_path = &source_path.
47 , fa_id = &fa_name.
48 , config_set_id = &config_set_id.
49 , load_input_area = Y
50 , load_landing_area = Y
51 , live_ETL = N
52 );
53%end;
54
55
56/* ************************************************* */
57/* Register MIP Modeling Systems */
58/* ************************************************* */
59
60/* Get the connection details for the MIP Server */
61%irm_get_service_info(SWCName = Model Imp Pltfrm Mid-Tier
62 , DeployedComponentName = Registered SAS Application
63 , ds_out = mip_info
64 );
65
66/* Load connection details into macro variables */
67data _null_;
68 set mip_info;
69 call symputx("mip_protocol", protocol, "G");
70 call symputx("mip_host", host, "G");
71 call symputx("mip_port", port, "G");
72 call symputx("mip_service", ksubstr(service, 2), "G");
73run;
74
75/* Get SAS Risk Workgroup root directory */
76%let sas_risk_workgroup_dir = %sysfunc(metadata_appprop(Risk Work Group Svr Cfg, root.dir));
77
78%macro tmp_import_all_mip_ms;
79 %local
80 TotMipMs
81 ticket
82 i
83 ;
84
85 /* Get a list of all MIP modeling systems */
86 %rsk_dir_list(directory = &source_path./mip/modeling_system
87 , ds_out = TMP_DIR_CONTENT
88 );
89
90 data _null_;
91 set TMP_DIR_CONTENT;
92 call symputx(cats("mip_ms_file_", _N_), FILE_PATH, "L");
93 call symputx(cats("mip_ms_name_", _N_), FILE_NAME, "L");
94 run;
95 %let TotMipMs = %rsk_attrn(TMP_DIR_CONTENT, nobs);
96
97 /* Loop through all MIP modeling systems */
98 %do i = 1 %to &TotMipMs.;
99
100 /* Copy Modeling System from the content package to the MIP location */
101 %irm_file_append(file = &&mip_ms_file_&i..
102 , toFile = &sas_risk_workgroup_dir./groups/&mipWorkgroup./SASModelImplementationPlatform/input/import/modeling_systems/&&mip_ms_name_&i..
103 );
104
105 %let mipMsName = %sysfunc(prxchange(s/\.mipms$//i, -1, %superq(mip_ms_name_&i.)));
106
107 /* Import Modeling System */
108 %irm_rest_import_mip_ms(host = &mip_protocol://&mip_host.
109 , port = &mip_port.
110 , server = &mip_service.
111 , username = &sasUser.
112 , password = &sasPassword.
113 , workgroup = &mipWorkgroup.
114 , msName = &mipMsName.
115 , outds = mip_import_details
116 );
117
118 %end;
119%mend;
120%tmp_import_all_mip_ms;
121