Hello! I am trying to run a code to create a conditional graph for a 2-way table. I used the code from my professor, and the following error code was produced. What's wrong, and how can I fix it? I'm fairly new to SAS so as simple as possible please 🙂
74 proc gchart data=online;
75 vbar response / group=type / freq=count;
-
22
200
NOTE: The previous statement has been deleted.
ERROR 22-322: Syntax error, expecting one of the following: ;, ANNOTATE, ASCENDING, AUTOREF,
CAUTOREF, CAXIS, CERROR, CFRAME, CFREQ, CLIPREF, CLM, COUTLINE, CPERCENT, CREF,
CTEXT, DESCENDING, DESCRIPTION, DISCRETE, ERRORBAR, FRAME, FREQ, FRONTREF,
G100, GAXIS, GROUP, GSPACE, HTML, HTML_LEGEND, IFRAME, IMAGESTYLE, INSIDE,
LAUTOREF, LEGEND, LEVELS, LREF, MAXIS, MEAN, MIDPOINTS, MINOR, MISSING, NAME,
NOAXIS, NOBASEREF, NOFRAME, NOLEGEND, NOSTATS, NOZERO, OUTSIDE, PATTERNID,
PERCENT, PERCENTSUM, RANGE, RAXIS, REF, SPACE, SUBGROUP, SUBOUTSIDE, SUM,
SUMVAR, TYPE, URL, WAUTOREF, WIDTH, WOUTLINE, WREF.
ERROR 200-322: The symbol is not recognized and will be ignored.
76 run;
ERROR: A HBAR, VBAR, HBAR3D, VBAR3D, STAR, PIE, PIE3D, DONUT or BLOCK statement must be given.
NOTE: The SAS System stopped processing this step because of errors.
Short answer: The slash means "options start here." You can only have one slash on a statement.
Longer answer: You and your professor might enjoy using the newer graphics that are available with PROC SGPLOT. Many customers find that SGPLOT easier to get started with. Here are two examples that use the VBAR statement. See the documentation for details.
proc sgplot data=sashelp.cars;
vbar origin / group=type freq=cylinders groupdisplay=stack;
run;
proc sgplot data=sashelp.cars;
vbar origin / group=type freq=cylinders groupdisplay=cluster;
run;
Short answer: The slash means "options start here." You can only have one slash on a statement.
Longer answer: You and your professor might enjoy using the newer graphics that are available with PROC SGPLOT. Many customers find that SGPLOT easier to get started with. Here are two examples that use the VBAR statement. See the documentation for details.
proc sgplot data=sashelp.cars;
vbar origin / group=type freq=cylinders groupdisplay=stack;
run;
proc sgplot data=sashelp.cars;
vbar origin / group=type freq=cylinders groupdisplay=cluster;
run;
Thank you!!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.