Old subject but often encountered.. It's possible to check the warning message and reinitialize the message. The syscc or syserr symbolic variables are not systematically set to another value than 0 in case of warning, so it could be impossible to pilote the warning message in conjunction with these variables. Further more, the syswarningtext is never reinitialize and can't be modify (read only value). A solution to circumvent the problem is to generated his own Warning Example : %macro WarningControle; %if %bquote(&SYSWARNINGTEXT) ne %str( ) %then %do; %put ERROR: Warning is here ! ; /* reinit */ %put WARNING: %str( ); %end; %else %put NOTE: No warning; %mend WarningControle; %put &=SYSWARNINGTEXT; axis1 label=(a=90 'Sum Age') order=(0 to 20 by 5) value=("0" "10" "20") ; proc gchart data = sashelp.class ; vbar sex / sumvar = age raxis=axis1 ; run; %put &=SYSWARNINGTEXT; %WarningControle %put &=SYSWARNINGTEXT; proc gchart data = sashelp.class ; vbar sex / sumvar = age raxis=axis1 /* Correction */ type=mean ; run; %WarningControle %put &=SYSWARNINGTEXT; SAS LOG : 23 %macro WarningControle; 24 %if %bquote(&SYSWARNINGTEXT) ne %str( ) 25 %then %do; 26 %put ERROR: Warning is here ! ; 27 /* reinit */ 28 %put WARNING: %str( ); 29 %end; 30 %else %put NOTE: No warning; 31 %mend WarningControle; 32 33 %put &=SYSWARNINGTEXT; SYSWARNINGTEXT= 34 35 axis1 label=(a=90 'Sum Age') order=(0 to 20 by 5) value=("0" "10" "20") ; 36 37 proc gchart data = sashelp.class ; 38 vbar sex / sumvar = age raxis=axis1 ; 39 run; WARNING: One or more bars in the VBAR chart of Sex were clipped to the range of the specified response axis. 40 41 %put &=SYSWARNINGTEXT; SYSWARNINGTEXT=One or more bars in the VBAR chart of Sex were clipped to the range of the specified response axis. 42 43 %WarningControle ERROR: Warning is here ! WARNING: 44 45 %put &=SYSWARNINGTEXT; SYSWARNINGTEXT= 46 NOTE: There were 19 observations read from the data set SASHELP.CLASS. NOTE: PROCEDURE GCHART used (Total process time): real time 0.06 seconds cpu time 0.02 seconds 47 proc gchart data = sashelp.class ; 48 vbar sex / sumvar = age raxis=axis1 /* Correction */ type=mean ; 49 run; 50 51 %WarningControle NOTE: No warning 52 53 %put &=SYSWARNINGTEXT; SYSWARNINGTEXT=
... View more