My department uses syscc to trap errors and warnings. Most of the time this is really helpful, however, I’ve either run into a very strange bug, or I’m doing something wrong.
The code below creates some data then plots 2 charts. The latter “%put &syscc;” – where title1 is set to a string 42 characters long - returns a value of 4, but “%put &syswarningtext;”doesn’t return anything, and Enterprise guide doesn’t identify it as a warning.
data test;
length x y 8;
infile datalines dsd;
input x y;
datalines;
1,1
2,2
;
run;
TITLE1 'This is forty one characters long. Honest';
PROC GPLOT DATA = WORK.test;
PLOT y * x;
run; quit;
%put &syscc;
%put &syswarningtext;
TITLE1 'This however, is forty two characters long';
PROC GPLOT DATA = WORK.test;
PLOT y * x;
run; quit;
%put &syscc;
%put &syswarningtext;
I’ve done some investigation and determined a few things -
- The value is set on the exit of gplot (either on hitting a quit or a subsequent data step).
- The Linesize option is set to 132, so it’s not that.
- It isn’t affected by the width of the chart - I thought it might be affected by the ability to fit the title over the chart.
Any thoughts? (NB Already submitted to SAS support. Race!)
*****************EDIT********************
Further investigation, prompted by Joe's answer below. It seems that one of the things that "goptions reset=all;" does is change the device from activeX to blank. While this fixes the title problem, it causes the real chart (but not the example) to throw other errors since it has a somewhat congested x-axis. It would be great to get both working. In the meantime, I think we will have weirdly short titles.
*****************EDIT2*******************
SAS Support have opened a (very small, low priority) defect about this. My first SAS bug!