Data visualization with SAS programming

PROC SGPLOT option error and warning

Reply
Occasional Contributor
Posts: 5

PROC SGPLOT option error and warning

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!

Super User
Posts: 19,194

Re: PROC SGPLOT option error and warning

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

Occasional Contributor
Posts: 5

Re: PROC SGPLOT option error and warning

I was running under SAS 9.2

Super Contributor
Posts: 252

Re: PROC SGPLOT option error and warning

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?

Occasional Contributor
Posts: 5

Re: PROC SGPLOT option error and warning

Sorry for the false alarm. I was on SAS 9.2

The code works fine under SAS 9.3 Smiley Happy

Ask a Question
Discussion stats
  • 4 replies
  • 952 views
  • 1 like
  • 3 in conversation