DATA Step, Macro, Functions and more

About basic keyword in SAS

Reply
Occasional Contributor
Posts: 11

About basic keyword in SAS

Hi all,

hope all doing well and Happy new year to all,

I am beginner SAS, I got confused with some of the terms in SAS :

 1) observations

2) Records

3) Statements

can someone explain in detail about these words?

 

Thank you in advance

PROC Star
Posts: 1,294

Re: About basic keyword in SAS

[ Edited ]

 1) observations= record= row

2) Records=observations=  row

3) Statements= perform an action

 

I highly recommend you get a book by author ron cody and read thoroughly: Just documentation alone may not help always

Learning SAS by Example: A Programmer's Guide
Book by Ron Cody
 
Image result for ron cody learning sas by example
 
Super User
Posts: 22,820

Re: About basic keyword in SAS


s_manoj wrote:

Hi all,

hope all doing well and Happy new year to all,

I am beginner SAS, I got confused with some of the terms in SAS :

 1) observations

2) Records

3) Statements

can someone explain in detail about these words?

 

Thank you in advance


It depends a lot on context. 

Of those, STATEMENT is the only one with a specific SAS definition. Other ones are functions and routines. 

 

Here’s a list of documented SAS Statements, there are more, see the link regarding STATEMENTS documented elsewhere. 

 

http://documentation.sas.com/?docsetId=lestmtsref&docsetTarget=p08st7rzfn0dgin1fml8hq40hlho.htm&docs...

 

The official SAS definition is:

Definition of Statements
A SAS statement is a string of SAS keywords, SAS names, special characters, and operators that instructs SAS to perform an operation or that gives information to SAS. Each SAS statement ends with a semicolon.

 

All of of this is in the documentation and the first programming course is free. 

SAS Super FREQ
Posts: 9,253

Re: About basic keyword in SAS

Hi:

  As Reeza explained, much of this is in the documentation. Please look at this web page: http://go.documentation.sas.com/?docsetId=lrcon&docsetTarget=n1rwem8pleuq62n1guwd91poym5p.htm&docset... and at the illustration on the web page, as shown below:

obs_doc.png

And, this same information is conveyed in Programming 1 in Lesson 3, in the video entitled Examining SAS Data Sets, as shown below, starting at time stamp 00:11 -- The video explains that more common/relational terms are observations=rows and variables=columns. In the old mainframe days, we used to refer to "records" and "fields" which were essentially the same as rows and columns. record=row=observation and field=column=variable...it just depends on your vintage of describing tables or data sets or files.

obs_var.png

I hope this points you toward an understanding.

cynthia

Highlighted
PROC Star
Posts: 8,098

Re: About basic keyword in SAS

I agree with the recommendations provided by @novinosrin and @Reeza, but there is definitely a distinction in SAS between records and observations.

 

Throughout the documentation records is used to describe the raw data being read into SAS, while observations is used to describe the individual rows of a SAS dataset. see, e.g., http://documentation.sas.com/?docsetId=basess&docsetTarget=n068wqvbjnndvjn17mqpoxdj7te7.htm&docsetVe...

 

Art, CEO, AnalystFinder.com

 

SAS Super FREQ
Posts: 9,253

Re: About basic keyword in SAS

Good point, Art!
cynthia
Ask a Question
Discussion stats
  • 5 replies
  • 259 views
  • 6 likes
  • 5 in conversation