SAS Documentation
SASĀ® Solution for Stress Testing
Reference manual - version 08.2021
Loading...
Searching...
No Matches
irmst_node_create_workgroup_dirs.sas
Go to the documentation of this file.
1/*
2 Copyright (C) 2018 SAS Institute Inc. Cary, NC, USA
3*/
4
5/** \file
6 \brief Create detail data folder structure
7
8 \details
9
10 This node ensures that all required detail data folders are available for the downstream steps
11
12 In addition the following macro utilities are called:
13
14 | Macro name | Description | Further information |
15 |---------------------------|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
16 | irm_session_prepare | Reads RUN_OPTION table and sets logging options | \link irm_session_prepare.sas \endlink |
17 | irm_session_cleanup | Removes all non-IRM WORK datasets/views and deletes all user-created macro variables from workspace session | \link irm_session_cleanup.sas \endlink |
18
19 \ingroup nodes
20 \author SAS Institute Inc.
21 \date 2018
22*/
23
24/* Initialize session */
25%irm_session_prepare();
26
27/* Get the list of workgroups */
28%rsk_dir_list(directory = &sas_risk_workgroup_dir./groups
29 , ds_out = tmp_dir_content
30 , recursive = N
31 , include_folders = Y
32 );
33
34/* Get distinct list of detail data folders */
35proc sql;
36 create table tmp_workgroups as
37 select distinct
38 t1.details_root
39 , t1.details_app
40 , t2.file_name as WORKGROUP
41 from
42 &ds_in. as t1
43 left join
44 tmp_dir_content as t2 on
45 1 = 1
46 ;
47quit;
48
49data &ds_out.;
50 set tmp_workgroups;
51 length
52 DETAIL_DATA_DIR $10000.
53 str $1024.
54 ;
55
56 drop str;
57
58 /* Set the detail data location */
59 if(not missing(details_root) and not missing(workgroup)) then do;
60 details_root = resolve(details_root);
61 details_app = resolve(details_app);
62 if(scan(details_root, -1, "/\") = "SASRiskandFinanceWorkbench") then do;
63 /* Detail data location will be under <details_root>/work_groups/<Workgroup>/detail_data */
64 detail_data_dir = catx("/", details_root, ifc(upcase(workgroup) = "PUBLIC", " ", cats("work_groups/", workgroup)), "detail_data");;
65 end;
66 else if(scan(details_root, -1, "/\") = "SASRiskWorkGroup") then do;
67 /* Detail data location will be under <details_root>/groups/<Workgroup>/<details_app>/detail_data */
68 detail_data_dir = catx("/", details_root, "groups", workgroup, details_app, "detail_data");;
69 end;
70 else do;
71 /* Detail data location will be under <Details Root>/<Workgroup> */
72 detail_data_dir = catx("/", details_root, workgroup);
73 end;
74
75 /* Create the detail data directory (if it does not exist) */
76 str = resolve(cats('%rsk_mkdirs(', detail_data_dir,')'));
77 end;
78run;
79
80/* Cleanup session */
81%irm_session_cleanup;