IF statements

Occasional Contributor
Posts: 5

IF statements

I have an IF statement that reads:

IF pregp ~= .;

What does ~= . denote?

Thanks for the help.

Trusted Advisor
Posts: 2,124

IF statements

The tilde (~) is a "logical operator" that means "not".  It is synonymous with the "^" symbol.

"." is the missing value for a numeric variable.

"IF <expression>;" is called a "subsetting IF" statement.

So, the statement means

IF pregp IS NOT EQUAL TO MISSING then continue (otherwise, read in another observation and start over at the beginning of the DATA step).

You can find out more about the logical operators and the subsetting IF statement format at support.sas.com by searching for those terms in the documentation.

Doc Muhlbaier


Occasional Contributor
Posts: 5

IF statements

This is very helpful, thank you.

Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation