I am new to SAS as a primarily R user until now. I am working on some basic examples in SAS to get going and the following is my code:
TITLE 'Bar Chart with Discrete Option';
PROC GCHART DATA=auto;
VBAR rep78/ DISCRETE;
The result is ERROR: Procedure GCHART not found. Why is this happening?
I do not have the University Edition! I already checked my SAS installation, results here:
Product expiration dates:
---Base SAS Software
---SAS Enterprise Miner
---MDDB Server common products
---SAS Enterprise Guide
---SAS/ACCESS Interface to PC Files
---SAS/ACCESS Interface to ODBC
---SAS Enterprise Miner for Desktop
---SAS Workspace Server for Local Access
---SAS Add-in for Microsoft Excel
Thanks for your help.
For a certain module to work in SAS, you must have it installed and licensed; since SAS/GRAPH is licensed, I suspect that your installation was not complete. This might be due to the deployment plan that was used.
Did you do the SAS installation yourself?
Oh, and one more tip -- if you are just getting started with SAS, I recommend learning PROC SGPLOT instead of GCHART for basic analytical graphs. Coming from R, you'll find the syntax a little bit cleaner and less verbose. SGPLOT is part of Base, not SAS/GRAPH.
You will want to use the SAS/GRAPH techniques to do more advanced tricks with drilldowns and geo maps, if you have those requirements.
Thank you for the suggestion to use SGPLOT in the University edition. This helped me solve a problem I was having on my first SAS assignment. Here is a code snippet to display the syntax difference between SGPLOT and GCHART for a bar graph displaying population percentages:
/** Does not work with the University Edition
proc gchart data=A;
vbar 'Place of Birth'n / freq=number
type=percent raxis=axis1 width=9 space=3;
proc sgplot data=A;
vbar 'Place of Birth'n / freq=number barwidth=.9 stat=percent ;
This is what I got when I typed in your suggestion, I'm using SAS University Edition. I am trying to create a 'simple graph' with data I have.
This is what I ran to receive the error (I Imagine this is leading cause in error):
proc sgplot data=/folder/myfolders
there's something else wrong with your code.
proc sgplot data=sashelp.class;
vbar sex / response=height stat=mean;
And you should get a vertical bar chart. Typically, you need the full name of a SAS dataset after data= in the PROC step.
You have only partial code. I would expect you to get an error on
proc sgplot data=/folders/myfolders;
for 2 reasons:
1) you are only pointing to a folder, not to a dataset in the folder
2) you do not have an action or plot statement, like vbar, hbar, scatter or series, etc.
I would expect my code to work for you in SAS University Edition.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.