Dear SAS experts ,
I cannot figure out the syntax error/warning that I keep getting while using PROC SGPLOT in 9.3.
So I have:
proc sgplot data=final sganno=anno ;
vbar val/response=per group=eot groupdisplay=stack grouporder=ascending
barwidth=0.4 datalabel=labels datalabelattrs=(size=6) missing;
keylegend / location=inside position=topright down=7 noborder;
xaxis display=NONE ;
yaxis values=(0 to 0.8 by 0.05) label="Propotion of ending treatment";
run;
1) I am getting the following error in log file and it looks like some issue with SGANNO option:
1664 +proc sgplot data=final sganno=anno ;
______
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, (, CYCLEATTRS, DATA, DESCRIPTION, NOAUTOLEGEND, NOCYCLEATTRS, TMPLOUT, UNIFORM.
The SAS System
ERROR 202-322: The option or parameter is not recognized and will be ignored.
1665 +
1666 +vbar val/response=per group=eot groupdisplay=stack grouporder=ascending
____________
1
WARNING 1-322: Assuming the symbol GROUP was misspelled as groupdisplay.
1666 !+vbar val/response=per group=eot groupdisplay=stack grouporder=ascending
__________
1
WARNING: Ignoring second data set reference.
ERROR: Variable STACK not found.
1667 + barwidth=0.4 datalabel=labels datalabelattrs=(size=6) missing;
_
22
76
ERROR: Variable ASCENDING not found.
WARNING 1-322: Assuming the symbol GROUP was misspelled as grouporder.
ERROR 22-322: Syntax error, expecting one of the following: ;, ALPHA, BARWIDTH, DATALABEL, FILL, FILLATTRS, FREQ, GROUP, LEGENDLABEL, LIMITATTRS, LIMITS, LIMITSTAT,
MISSING, NAME, NOFILL, NOOUTLINE, NOSTATLABEL, NUMSTD, OUTLINE, RESPONSE, STAT, TRANSPARENCY, URL, WEIGHT.
ERROR 76-322: Syntax error, statement will be ignored.
2) Next, I commented out SGANNO option and reran the program. This time it wont process options under VBAR and get the following warning/error:
WARNING 1-322: Assuming the symbol GROUP was misspelled as groupdisplay
ERROR: Variable STACK not found
ERROR: Variable ASCENDING not found.
I cannot figure out why!
What version of SAS are you on? The SG procedures evolved quickly over the last few versions of SAS.
I was running under SAS 9.2
Hi, I cannot understand at the moment either. Can you please upload the final dataset, and possibly the annotation dataset? Are you sure you have SAS 9.3?
Sorry for the false alarm. I was on SAS 9.2
The code works fine under SAS 9.3
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.