/* query number of graphs in catalog and create macro variable */
   /* reflecting the total                                        */
data _null_;
   rc=gset('catalog','work','gseg');
   rc=ginit();
   call gask('numgraph',num,rc2);
   call symput('total',trim(left(num)));
   rc=gterm();
run;

goptions display; /* set GOPTIONS to display graphs               */