LIBNAME dev "/team/decision_science/Customer_Modelling/Project/013_Foundation_Customer_Score/Data/Development Sample/Jun19/Stratified Samples" access=readonly;
LIBNAME MRAV "/team/analytics_mod/Technical_Validation/01_Retail/04_Unsecured/FCS_StageD_Rerun/Data";
data dormant_pca_cc;
set dev.fcs_jun19_dorm_pca_cc_build;
drop CSV2_2_exclusion_7_bnkrpt CSV2_2_exclusion_8_dceasd CSV2_2_exclusion_9_basic_dorm
bcoms_active_9m_frm_Jun19 bcoms_stays_active_9m_frm_Jun19;
run;
%SYSMSTORECLEAR;
LIBNAME modmacro "/team/decision_science/xTeam/.modelling_macro/" access=readonly;
OPTIONS noimplmac obs=max mstored sasmstore=modmacro;
* Create the bindings dataset *;
DATA bandings;
LENGTH varname $ 40 grps $ 2000;
INPUT type modtype inmod varname $ grps $;
CARDS;
2 1 1 BU_419_DQ :"0_","U","ND":
1 1 1 BU_26_AB_NUM :0:
1 1 1 BU_345_HN_NUM :0:25:75:
1 1 1 RR_CHR_105 :200:
1 1 1 BU_162_GG_NUM :120:180:360:
1 1 1 RR_CHR_169 :-9999997:5:30:
1 1 1 BU_799_TEB_NUM :0:1:2:
1 1 1 RR_CHR_111 :2000:
1 1 1 BU_301_PL_NUM :0:
1 1 1 BU_1552_SHC_NUM :.N:0:
1 1 1 BU_1577_RIC_NUM :0:50:
1 1 1 RR_CHR_122 :0:
2 1 1 E1_B_07 :"0","N","T","U":
1 1 1 bu_670_uz_num :-1:1000:
;
RUN;
* Create the dataset labels *;
DATA labels;
LENGTH varname $ 15 grps $ 300;
INPUT varname $ grps $;
CARDS;
RUN;
* Execute the model SAS macro *;
%MODEL(
set=dormant_pca_cc,
scoreset=MRAV.dormant_pca_cc,
outcome=FCS_bad_9m_Jun19,
weight=weight,
holdout=holdout,
oscore=CSv2_2,
drop=1,
user=Arjayita Ghosh,
progname=Dormant_PCA_CC
);
I have attached the base code for better understanding 🙂
A macro call with a parameter list without the complete definition of the macro as in
%MODEL( set=dormant_pca_cc, scoreset=MRAV.dormant_pca_cc, outcome=FCS_bad_9m_Jun19, weight=weight, holdout=holdout, oscore=CSv2_2, drop=1, user=Arjayita Ghosh, progname=Dormant_PCA_CC );
Does not really provide much for better understanding.
Some where there is code that starts with
%macro Model(<parameters>); and ends with %mend;
that describes the macro and we could discuss that.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.