There is no better guide to SAS/GRAPH than the examples contained in the award-winning SAS/GRAPH documentation:
http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/gchart-bar.htm
http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/gr13n07-ex.htm
http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/gr13n03-ex.htm
And the SAS Notes:
http://support.sas.com/kb/24/870.html
And this is a good paper:
http://analytics.ncsu.edu/sesug/2004/TU02-Cochran.pdf
If UNITS and PURCHASED are numeric variables, you would not typically use them as BY group variables for graphing purposes. Especially since you said you wanted to have Units Purchased on the Y axis -- this makes me wonder whether you have 1 variable with a label of "Units Purchased" -- but -- the way you have your BY statement coded, it looks like there are 2 numeric variables called UNITS and PURCHASED that are being used as BY group variables (instead of 1 variable).
Generally, you do not refer to a variable
LABEL (such as "Units Purchased" in any SAS statement, you refer to the variable NAME. So if the variable name is UNITSSOLD, it might have a label of "Units Sold"; or if the variable name is UNITSPURCHASED, it might have a label of "Units Purchased". One of the fundamental concepts of SAS variable names is that the variable name cannot contain spaces or any character other than an underscore (_). To refer to a variable any other way, you must use a different naming convention. As explained in the documentation:
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000998953.htm
In the documentation for the HBAR statement, you will want to pay particular attention to the SUMVAR= option and the GROUP= option for the HBAR statement. There are many examples that show the use of these options with PROC GCHART. (Also, you might want to investigate the differences between an HBAR chart and a VBAR chart, especially if you want "Units Purchased" on the Y axis.)
In addition, BY group processing is often used in the creation of SAS/GRAPH output when you want the same graph image created for every BY group category, such as:
[pre]
by country; (one graph for each country value)
by type; (one graph for each type value)
by country type; (one graph for every unique combo of country and type values)
etc.
[/pre]
So, aside from issues of using the variable NAME, instead of the variable LABEL, it would still not be typical usage to have a BY statement with:
[pre]
by unitssold;
by unitsspurchased;
[/pre]
(Especially not typical if you wanted "Units Purchased" to be on the Y axis).
So, I would also suggest that you also read this documentation on BY group processing concepts:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000060410.htm
cynthia