Vous êtes sur la page 1sur 5

2

Macro : %Promo_Basket_Extract

%Promo_Basket_Extract

( banner = ,
region_name = ,
start_date = ,
end_date = ,

Macro:

fiscal_week_end_dt =,
promonum=,
get_extra_var =,
output_dataset =);

SAS code:

Promo_Basket_Extract .sas

Details:

This macro is developed to extract promo transactions from the Promotion Basket Star for given regi

Input
Parameters:

Below are the various parameters that the user needs to provide to use the macro.

Banner

= List of Banner codes each value enclosed

Copyright Clear Cell Limited 2009

in quotes ' , if more than

-To get Sobeys banner Transactions give banner=005


-To get Food Land Transactions give banner=031
-To get Transactions for both Sobeys and Food Land give

Region_name

= Region Name (First letter of region name)


A - for Atlantic
Q - for Quebec
W - for West
O - for Ontario

Start_date

= Start date of the Extraction Period, which should be in date9.


To get transactions for one week (i.e. 2012W40), the parameter
Start_date=5FEB2012

End_date

= End date of the Extraction period, which should be in date9. Format.


To get transactions for one week say 2012W40, the parameter
End_date=11FEB2012

Fiscal_week_end_dt

= Fiscal week end date, which should be in date9. Format.


To get exactly one week transactions say for week 201240, the
Fiscal_week_end_dt=11FEB2012

Copyright Clear Cell Limited 2009

Output_dataset

= Name of the output transaction dataset

Promonum

= List of promotion numbers separated by spaces,


For example if you want to promotion baskets for promotion number
Promonum=67933

Get_extra_var

= List of extra variables we want to include in the output dataset apart


separated by -.

For example, if we want to extract two more variables from the

Get_extract_var = item_dim.item_rk-item_dim.item_upc_cd

If we want to extract one variable, ad_week_no, from time_dim and


should read:

Get_extra_var = time_dim.ad_week_no-sales_analysis_fact.cashier_no

The variables from these tables can be called from this macro
Item_dim
Time_dim
Retail_outlet_dim
Copyright Clear Cell Limited 2009

6793

Financial_hier_dim
Sales_analysis_fact

Sample
Call:

Example 01:

To get all the promotion baskets for Atlantic Sobeys for one day 26Jan2010 with no ex

%Promo_Basket_Extract (Banner=005,
Region_name=A,
Start_date=26Jan2010,
End_date=26Jan2010,
Fiscal_week_end_dt=,
Promonum=,
Get_extra_var=,
Output_dataset=promo_basket_extract);

Example 03:

To get Ontario Sobeys and Urban banner transactions for week for promotion numbe

%Promo_Basket_Extract (banner=005 017,


Region_name=O,
Start_date=01FEB2010,
End_date=28FEB2010,
Fiscal_week_end_dt=,
Promonum=67933 67934

Copyright Clear Cell Limited 2009

Get_extra_var=time_dim.ad_week_no-

retail_

Output_dataset=Promo_Basket_Extract);

CMA_PROMO_BASKET_FACT
TIME_DIM
RETAIL_OUTLET_DIM
Input data:
PROMO_COND_REWARD_TYPE_DIM
PROMO_DIM
LINKED_CUSTOMER_CARD
MEMBER_DIM
1.Values for the parameters are necessary for BANNER,REGION_NAME, START_DATE
AND END_DATE
2.Optional parameters are GET_EXTRA_VAR ,OUTPUT_DATASET AND PROMONUM

Instructions

3.While passing date parameters give either both Start_date and End_date OR
Fiscal_week_end_dt, Format for these parameters is Date9.
4.While giving specific promotion numbers, user should give start and end dates according to the
Promotion start and promotion end dates.

Copyright Clear Cell Limited 2009

Vous aimerez peut-être aussi