BookmarkSubscribeRSS Feed
Lani
Calcite | Level 5
Hello ~

I am learning SAS basic by reading documentation and examples. I'd like to know how to identify the SAS keywords. Please see the below example:

data groc;
input Region $9. Manager $ Department $ Sales;
datalines;
Southeast Hayes Paper 250
Southeast Hayes Produce 100
Southeast Hayes Canned 120
Southeast Hayes Meat 80
...more lines of data...
Northeast Fuller Paper 200
Northeast Fuller Produce 300
Northeast Fuller Canned 420
Northeast Fuller Meat 125
;

proc sort data=groc;
by region department;
run;

options nobyline nodate pageno=1
linesize=64 pagesize=20;

proc chart data=groc;
by region department;
vbar manager / type=sum sumvar=sales;
title1 'This chart shows #byval2 sales';
title2 'in the #byval(region)..';
run;
options byline;


Could someone please help me to understand the meaning of the followings and point out what are the SAS keywords that are used. Where can I read more about SAS keywords or SAS options? Thank you VERY much for your help. I appreciate your value time.

1. vbar manager / type=sum sumvar=sales;
2. #byval2
3. #byval(region)..';
4. nobyline
5. options byline;
6. options nobyline nodate pageno=1
2 REPLIES 2
LinusH
Tourmaline | Level 20
For general SAS documentation (including keywords, syntax etc) see on-line doc:
http://support.sas.com/documentation/index.html.

For PROC GCHART specifics, see http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/a000723580.htm.

/Linus
Data never sleeps
Doc_Duke
Rhodochrosite | Level 12
Lani,

One of the challenges for a learner is that SAS keywords are context sensitive. Because of that context sensitivity, I think, I've never seen a general keyword list. This allows for flexible programming, but can also lead to confusing code, particularly for a newbie. For instance,

DATA data.data;

is a legitimate SAS statement with one keyword and one (compound) argument. But please don't write code like that, it can be really hard to untangle when there is a problem.

One of the better ways to find out about keywords in SAS is to go to support.sas.com and enter "keyword YourSpecificKeyword" into the search box. It doesn't always work, but it has a lot more "hits" than "misses."

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

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
  • 2 replies
  • 1287 views
  • 0 likes
  • 3 in conversation