DATA Step, Macro, Functions and more

X+1; Why?

Reply
Contributor
Posts: 25

X+1; Why?

A colleague of mine is wondering how the syntax:

x+1;

works. It obviously produces the same result as:

x=x+1;

but she wants to understand why.

Thanks!
Super Contributor
Super Contributor
Posts: 3,174

Re: X+1; Why?

Review the topic of how a SAS DATA step performs a "retain" or doesn't, depending on the statement syntax and/or whether you have coded a RETAIN statement.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

data step retain value site:sas.com
Contributor
Posts: 25

Re: X+1; Why?

This didn't sufficiently address the question of why this works.
Regular Contributor
Posts: 165

Re: X+1; Why?

Go to the online doc and search "sum statement syntax"
Contributor
Posts: 25

Re: X+1; Why?

Thank you
Ask a Question
Discussion stats
  • 5 replies
  • 180 views
  • 0 likes
  • 4 in conversation