Usage Note 49662: SAS® Promotion Optimization promotion that contains products from multiple partitions cannot be evaluated or optimized
SAS® Promotion Optimization does not support evaluating or optimizing promotions that contain products from multiple data partitions. You should disable promotions that cross partitions before you run batch optimization.
Select the Full Code tab in this note to access a program that identifies promotions that cross partitions.
An enhancement is planned for a future software release.
Operating System and Release Information
SAS System | SAS Promotion Optimization | Microsoft® Windows® for x64 | 5.2 | | 9.3 TS1M1 | |
Linux for x64 | 5.2 | | 9.3 TS1M1 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
This SAS® program identifies promotions that cross partitions that batch optimization would process. These promotions should be disabled before batch optimization is run.
This program must run in a SAS session where the SAS® Merchandise Intelligence libraries are pre-defined. The code assumes that the librefs DI_DM and DI_TRANS are assigned.
* retrieve PROD_PARTITION_LVL global setting;
proc sql noprint;
select spec_value into :PROD_PARTITION_LVL
from di_dm.global_setting
where spec_nm = 'PROD_PARTITION_LVL' and app = 'ALL';
quit;
run;
%PUT PROD_PARTITION_LVL = &PROD_PARTITION_LVL;
* build a list of partitions for all plans where that optimization would process;
proc sql noprint;
create table tmp_plan1 as
select p.plan_sk, p.plan_id, p.start_dt, p.end_dt, s.prod_hier_sk, s.geo_hier_sk,
h.parent_prod_hier_sk as PARTITION_ID
from di_trans.rpp_plan p, di_trans.scope_detail s, di_trans.product_hier_assoc_dm h
where p.eval_opt_process_cd in (0,100,900,901)
and p.plan_type not in (1,4)
and p.eval_opt_req_cd in (1,2,3)
and p.plan_sk not in (select active_plan_sk from di_trans.rpp_plan where plan_type = 2)
and p.objective_sk = s.scope_sk
and h.prod_hier_assoc_cd = 1
and s.prod_hier_sk = h.prod_hier_sk
and h.parent_prod_lvl = &PROD_PARTITION_LVL;
quit;
run;
* count how many partitions each plan has;
proc sql noprint;
create table tmp_plan2 as
select distinct plan_sk, partition_id
from tmp_plan1;
quit;
run;
proc sql noprint;
create table tmp_plan3 as
select plan_sk, count(partition_id) as nbr_partitions
from tmp_plan2
group by plan_sk;
quit;
run;
* keep only those plans that cross partitions;
proc sql noprint;
create table tmp_plan4 as
select distinct p.plan_sk, p.plan_id, datepart(p.start_dt) as START_DT format date11., datepart(p.end_dt) as END_DT format date11., p.partition_id
from tmp_plan1 p;
quit;
run;
proc sql noprint;
create table plans_to_disable as
select p.plan_sk, p.plan_id, p.start_dt, p.end_dt, p.partition_id, d.prod_id as PARTITION_NM
from tmp_plan4 p, tmp_plan3 c, di_dm.product_dm d
where p.plan_sk = c.plan_sk
and c.nbr_partitions > 1
and p.partition_id = d.prod_hier_sk
order by p.plan_sk, p.plan_id, p.start_dt, p.end_dt;
quit;
run;
* print results;
proc print data=plans_to_disable;
Title 'These plans cross partitions. Opt/eval will fail for them. These plans should be disabled.';
by plan_sk plan_id start_dt end_dt;
var partition_id partition_nm;
label partition_id = 'PARTITION_ID';
label partition_nm = 'PARTITION_NM';
run;
Type: | Usage Note |
Priority: | high |
Date Modified: | 2013-05-30 13:21:43 |
Date Created: | 2013-04-16 11:04:39 |