Resources

Annotate Facility with PROC NETDRAW (netdr16)

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: NETDR16                                             */
/*   TITLE: Annotate Facility with PROC NETDRAW (netdr16)       */
/* PRODUCT: OR                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: NETDRAW                                             */
/*   PROCS: FORMAT, NETDRAW                                     */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT:                             UPDATE:                 */
/*     REF: Example 16 from the NETDRAW Chapter(PM User's Guide)*/
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

 /* Define format for the ALIGN= variable */
proc format;
   value classtim 1 = ' 9:00 - 10:00'
                  2 = '10:00 - 11:00'
                  3 = '11:00 - 12:00'
                  4 = '12:00 - 1:00 '
                  5 = ' 1:00 - 2:00 '
                  6 = ' 2:00 - 3:00 ';
   run;

data schedule;
   format day $9. class $12. ;
   input day $ class &  time daytime $ msucc $;
   format time classtim.;
   label day = "Day \ Time";
   datalines;
Monday     Mathematics    1   m1   .
Monday     Language       2   m2   .
Monday     Soc. Studies   3   m3   .
Monday     Art            5   m4   .
Monday     Science        6   m5   .
Tuesday    Language       1   t1   .
Tuesday    Mathematics    2   t2   .
Tuesday    Science        3   t3   .
Tuesday    Music          5   t4   .
Tuesday    Soc. Studies   6   t5   .
Wednesday  Mathematics    1   w1   .
Wednesday  Language       2   w2   .
Wednesday  Soc. Studies   3   w3   .
Wednesday  Phys. Ed.      5   w4   .
Wednesday  Science        6   w5   .
Thursday   Language       1   th1  .
Thursday   Mathematics    2   th2  .
Thursday   Science        3   th3  .
Thursday   Phys. Ed.      5   th4  .
Thursday   Soc. Studies   6   th5  .
Friday     Mathematics    1   f1   .
Friday     Language       2   f2   .
Friday     Soc. Studies   3   f3   .
Friday     Library        5   f4   .
Friday     Science        6   f5   .
;


data anno;
   /* Set up required variable lengths, etc. */
   length function color style   $8;
   length xsys ysys hsys         $1;
   length when position          $1;

   xsys     = '2';
   ysys     = '2';
   hsys     = '4';
   when     = 'a';

   function = 'label   ';
   x = 4;
   size = 2;
   position = '5';
   y=5; TEXT='L'; output;
   y=4; TEXT='U'; output;
   y=3; TEXT='N'; output;
   y=2; TEXT='C'; output;
   y=1; TEXT='H'; output;
   run;


pattern1 v=s c=pink;
title 'Class Schedule: 2003-2004';
footnote j=l h=2 '  Teacher: Mr. A. Smith Hall'
         j=r h=2 'Room: 107  ';
proc netdraw graphics data=schedule anno=anno;
   actnet / act=daytime
            succ=msucc
            id=(class)
            nodefid nolabel
            zone=day
            align=time
            useformat
            linear
            pcompress
            coutline=black
            hmargin = 2 vmargin = 2
            htext=2;
   run;