Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Otherwise; optional to otherwise output other

end;

 

To avoid errors due to capitalisation, use the upcase or lowcase function, e.g., select (lowcase(<variable>))

 

To collapse levels of a variable, e.g, to collapse value 3 into 2

...

Inclusive range for IF statement can be achieved with: 5 le <variable> le 7; gives observations between 5-7 inclusive

   

Numerical operators

 

Mean

Arithmetic   mean

Sum

Sum or   arguments

Var

Variance

Sin

Sine

Log

Natural   log

SQRT

Square   root

ABS

Absolute   value

 

Logical  operators

Modify where expressions: not / and / or

Eg where city not in('London','Rome','Paris') = city is not London, Rome or Paris

 

Comparison operators

 

Equal to

eq

=

Not equal   to

ne

 

Less than

lt

<

Greater   than or equal

ge

>=

Less than   or equal

le

<=

Equal to   one of a list

in

 

 

Special where operators (can only be used for where statements)

 

Operator

Definition

Char

num

Contains

Includes   substring

x

 

Between   and

Inclusive   range

x

x

Is null

A missing   value

x

x

Is   missing

A missing   value

x

x

Like

Matches a   pattern

x

 

Where   same and

Augments   original condition

x

x