37%irm_session_prepare();
41 set &ds_in_cardinality.;
42 call symputx(
"n_partitions", max_rank_no,
"L");
46 data work.bep_summary_exp;
47 set &ds_in_bep_summary.;
48 original_targetVariable = targetVariable;
49 original_accountID = accountID;
50 original_planningDataKey = planningDataKey;
51 original_dataDefSchemaName = dataDefSchemaName;
52 original_dataDefSchemaVersion = dataDefSchemaVersion;
53 do i=1 to countw(original_targetVariable,
",");
54 targetVariable = scan(original_targetVariable,i,
",");
55 accountID = scan(original_accountID,i,
",");
56 planningDataKey = scan(original_planningDataKey,i,
",");
57 dataDefSchemaName = scan(original_dataDefSchemaName,i,
",");
58 dataDefSchemaVersion = scan(original_dataDefSchemaVersion,i,
",");
65 %let TotRows = %rsk_attrn(work.bep_summary_exp, nobs);
68 %let rows_x_partition =1;
69 %
if %sysevalf(&rows_x_partition. * &n_partitions. > &TotRows.,
boolean) %then %
do;
70 %put ERROR:You system has &n_partitions threads which means you can have that many source tables as max;
72 %let fromRow = %sysevalf((&rank. -1 ) * &rows_x_partition. + 1);
73 %let toRow = &fromRow.;
75 data &ds_out_bsp_data_config.;
77 set &ds_in_bsp_data_config.(firstobs = &fromRow. obs = &toRow.);
80 call symputx(
"source_data_name",source_data_name ,
"L");
81 call symputx(
"source_data_version",source_data_version ,
"L");
82 call symputx(
"analysis_data_key",analysis_data_key ,
"L");
83 call symputx(
"scenario_name", scenario_name,
"L");
88 create table work.ds_out_agg_rules_config as
92 from &ds_in_agg_rules_config. rules
93 inner join work.bep_summary_exp summary
94 on upcase(rules.tgt_table_schema_nm) = upcase(summary.dataDefSchemaName)
95 and upcase(rules.src_table_schema_nm) ne upcase(rules.tgt_table_schema_nm)
96 and upcase(resolve(rules.tgt_table_schema_ver)) = upcase(resolve(summary.dataDefSchemaVersion))
98 where upcase(config.src_table_schema_nm) = upcase("&source_data_name.")
99 and upcase(resolve(config.src_table_schema_ver)) = upcase("&source_data_version.")
104data &ds_out_agg_rules_config.;
105 set work.ds_out_agg_rules_config;
106 tgt_table_schema_ver = resolve(tgt_table_schema_ver);
107 src_table_schema_ver = resolve(src_table_schema_ver);
111%if not %rsk_attrn(&ds_out_agg_rules_config.,nobs) %then %do;
112 %put ERROR: There are no aggregation rules configured for the selected planning data.;
116%irmst_fltr_src_agg_tbl(scenario_name = &scenario_name.
117 , ds_in_source_key = &analysis_data_key.
118 , ds_in_agg_rules_config = &ds_out_agg_rules_config.
119 , ds_out_filtered = &ds_out_src_tbl_detail.
123%if not %rsk_attrn(&ds_out_src_tbl_detail.,nobs) %then %do;
124 %put WARNING: There are no observations in the source table.;