DATA Step, Macro, Functions and more

if ^ a then do

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

if ^ a then do

I'm not sure what the "^" mean here: if ^ a then do...

does it mean "if ^= a then do"?

thanks


Accepted Solutions
Solution
‎06-18-2017 01:55 PM
Super User
Posts: 5,099

Re: if ^ a then do

In this context, ^ means "not".  The evaluation of "a" is considered to be false when a is either missing or zero.  Any other value gets evaluated as true.  So "^ a" gets evaluated as true whenever a is missing or zero.  Any other value gets evaluated as false. Putting it all together:

 

if ^ a then do;

 

The statements that follow get performed whenever the variable A is either missing or zero.

View solution in original post


All Replies
Solution
‎06-18-2017 01:55 PM
Super User
Posts: 5,099

Re: if ^ a then do

In this context, ^ means "not".  The evaluation of "a" is considered to be false when a is either missing or zero.  Any other value gets evaluated as true.  So "^ a" gets evaluated as true whenever a is missing or zero.  Any other value gets evaluated as false. Putting it all together:

 

if ^ a then do;

 

The statements that follow get performed whenever the variable A is either missing or zero.

PROC Star
Posts: 265

Re: if ^ a then do

^ is not

so ^= not equal to

 

New Contributor
Posts: 2

Re: if ^ a then do

thanks!
Super User
Posts: 17,963

Re: if ^ a then do

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 189 views
  • 3 likes
  • 4 in conversation