The following example
program defines the librefs and macro variables to test the %MM_RunReports()
macro's ability to assess home equity performance data for multiple
time periods. Before this section of code can be run, the report specifications
must be defined in SAS data sets and the model must be extracted from
the publishing channel.
For more information, see Define the Report Specifications and Extracting the Champion Model from a Channel.
The example program
sets the current time to a time that would trigger the creation of
data sets or the updating of data sets that underlie the model monitoring
reports. When you run your batch program in a production environment,
you do not need a variable to set the current time. When no value
is set for the current time, the %MM_RunReports() macro uses the system
timestamp as the value of the current time variable.
The highlighted values
are user-supplied values.
/* Source file name: sashelp.modelmgr.reportExample4.source */
FILENAME repmacro catalog 'sashelp.modelmgr.reportmacros.source';
%inc repmacro;
/* Fileref to the encoded password */
FILENAME pwfile "my-network-path\pwfile";
/**************************************************/
/* Specify the report execution metadata and */
/* configure the _MM_ macro variables to run the */
/* report job in TEST mode. */
/**************************************************/
%let _MM_ReportMode=TEST;
%let _MM_User=mmuser1;
data _null_;
infile pwfile obs=1 length=l;
input @;
input @1 line $varying1024. l;
call symput('_MM_Password',substr(line,1,l));
run;
;
%let _MM_MulticastAddress=239.27.18.213;
%let _MM_MulitcastPort=8561;
%let _MM_PathMayChange=Y;
%let _MM_JobLocalPath=c:\mm.test\report.auto;
%let _MM_ModelLocalPath=c:\mm.test\model.extraction;
LIBNAME mm_jobs "&_MM_JobLocalPath";
LIBNAME mm_meta "&_MM_ModelLocalPath";
LIBNAME scoreIn 'c:\mm.test\score.in';
%let mapTable=mm_meta.current;
/***************************************************/
/* DATA step scoreIn.hmeq0 */
/* */
/* First, run the 2011Q4 report.It is necessary to */
/* artificially declare a "currentTime" argument */
/* of 01Jan2012 in order to trigger the report */
/* execution scheduled for the 2011Q4 interval. */
/***************************************************/
DATA scoreIn.hmeq0;
set scoreIn.hmeq_2011Q4;
run;
%let currentTime=01Jan2012:12:30:15;
%MM_RunReports(
localpath=&_MM_JobLocalPath,
currentTime=¤tTime,
mapTable=&mapTable,
user=&_MM_User,
password=&_MM_Password);
/***************************************************/
/* Now, run the 2012Q1 report. It is necessary to */
/* artificially declare a "currentTime" argument */
/* of 03Apr2012 in order to trigger the report */
/* execution scheduled for the 2011Q1 interval. */
/***************************************************/
DATA scoreIn.hmeq0;
set scoreIn.hmeq_2012q1;
run;
%let currentTime=03Apr2012:12:30:15;
%MM_RunReports(
localpath=&_MM_JobLocalPath,
currentTime=¤tTime,
mapTable=&mapTable,
user=&_MM_User,
password=&_MM_Password);
/***************************************************/
/* Now, run the 2011Q2 report. It is necessary to */
/* artificially declare a "currentTime" argument */
/* of 03Jul2011 in order to trigger the report */
/* execution scheduled for the 2011Q2 interval. */
/***************************************************/
DATA scoreIn.hmeq0;
set scoreIn.hmeq_2011q2;
run;
%let currentTime=03Jul2011:12:30:15;
%MM_RunReports(
localpath=&_MM_JobLocalPath,
currentTime=¤tTime,
mapTable=&mapTable,
user=&_MM_User,
password=&_MM_Password);
/***************************************************/
/* Now, run the 2011Q3 report. It is necessary to */
/* artificially declare a "currentTime" argument */
/* of 03Oct2011 in order to trigger the report */
/* execution scheduled for the 2011Q3 interval. */
/***************************************************/
DATA scoreIn.hmeq0;
set scoreIn.hmeq_2011q3;
run;
%let currentTime=03Oct2011:12:30:15;
%MM_RunReports(
localpath=&_MM_JobLocalPath,
currentTime=¤tTime,
mapTable=&mapTable,
user=&_MM_User,
password=&_MM_Password);
/***************************************************/
/* Now, run the 2011Q4 report. It is necessary to */
/* artificially declare a "currentTime" argument */
/* of 03Jan2012 in order to trigger the report */
/* execution scheduled for the 2011Q4 interval. */
/***************************************************/
DATA scoreIn.hmeq0;
set scoreIn.hmeq_2011q4;
run;
%let currentTime=03Jan2012:12:30:15;
%MM_RunReports(
localpath=&_MM_JobLocalPath,
currentTime=¤tTime,
mapTable=&mapTable,
user=&_MM_User,
password=&_MM_Password);