BookmarkSubscribeRSS Feed
Kysu
Calcite | Level 5

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!

4 REPLIES 4
Reeza
Super User

What version of SAS are you on? The SG procedures evolved quickly over the last few versions of SAS.

Kysu
Calcite | Level 5

I was running under SAS 9.2

djrisks
Barite | Level 11

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?

Kysu
Calcite | Level 5

Sorry for the false alarm. I was on SAS 9.2

The code works fine under SAS 9.3 Smiley Happy

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 2042 views
  • 1 like
  • 3 in conversation