Resources

Printing the Schedule on a Calendar (cpme04)

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CPME04                                              */
 /*   TITLE: Printing the Schedule on a Calendar (cpme04)        */
 /* PRODUCT: OR                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: CPM                                                 */
 /*   PROCS: CPM, CALENDAR                                       */
 /*    DATA:                                                     */
 /*                                                              */
 /* SUPPORT:                             UPDATE:                 */
 /*     REF: Example 4 from the CPM Chapter (PM User's Guide)    */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/

 /* Activity-on-Arc representation of the project */



data widgaoa;
   input task $ 1-12 days tail head;
   datalines;
Approve Plan   5   1   2
Drawings      10   2   3
Study Market   5   2   4
Write Specs    5   2   3
Prototype     15   3   5
Mkt. Strat.   10   4   6
Materials     10   5   7
Facility      10   5   7
Init. Prod.   10   7   8
Evaluate      10   8   9
Test Market   15   6   9
Changes        5   9  10
Production     0  10  11
Marketing      0   6  12
Dummy          0   8   6
;


proc cpm data=widgaoa out=save
   date='1dec03'd interval=day;
   tailnode tail;
   headnode head;
   duration days;
   id task;
   run;

proc sort data=save out=crit;
   where t_float=0;
   by e_start;
   run;

title 'Printing the Schedule on a Calendar';
title2 'Critical Activities in December';

/* print the critical act. calendar  */
options nodate pageno=1 pagesize=50;

proc calendar schedule
     data=crit;
   id e_start;
   where e_finish <= '31dec03'd;
   var task;
   dur days;
   run;

/* sort data for early start calendar */
proc sort data=save;
   by e_start;

/* print the early start calendar */
title2 'Early Start Schedule for December';
options nodate pageno=1 pagesize=50;
proc calendar schedule data=save;
   id e_start;
   where e_finish <= '31dec03'd;
   var task;
   dur days;
   run;