14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 5 JSL Building Blocks 77<br />

Operators<br />

Table 5.3 Operators and Their Function Equivalents in Order of Precedence (Continued)<br />

Operator Function Syntax Explanation<br />

++ Post<br />

Increment<br />

–– Post<br />

Decrement<br />

a++<br />

Post Increment(a)<br />

a––<br />

Post Decrement(a)<br />

Adds one (1) to a, in place.<br />

Subtracts one (1) from a, in place.<br />

^ Power a^b<br />

Power(a,b)<br />

Power(x)<br />

– Minus –a<br />

Minus(a)<br />

! Not !a<br />

Not(a)<br />

* Multiply a*b<br />

Multiply(a,b)<br />

:* EMult a:*b<br />

EMult(a,b)<br />

/ Divide a/b<br />

Divide(a,b)<br />

Divide(x)<br />

:/ EDiv a:/b<br />

EDiv(a,b)<br />

+ Add a+b<br />

Add(a,b)<br />

– Subtract a–b<br />

Subtract(a,b)<br />

|| Concat a||b<br />

Concat(a,b)<br />

|/ VConcat matrix1|/matrix2<br />

VConcat(matrix1,<br />

matrix2)<br />

Raise a to exponent power b. With only<br />

one argument, 2 is assumed as the<br />

power, so Power(x) computes x 2 .<br />

Reverses sign of a.<br />

Logical Not. Maps nonzero (or true)<br />

values to 0 (which means false). Maps 0<br />

(or false) values to 1 (which means true).<br />

Multiplies a by b.<br />

Elementwise multiplication for matrices<br />

a and b. (Each element in matrix a is<br />

multiplied by each element in matrix b.)<br />

Divide(a, b) divides a by b.<br />

Divide(x) interprets the argument as a<br />

denominator and implies 1 as the<br />

numerator, yielding the reciprocal 1/x.<br />

Elementwise division for matrices a and<br />

b. (Each element in matrix a is divided<br />

by each element in matrix b.)<br />

Adds a and b.<br />

Subtracts b from a.<br />

Concatenates strings together and<br />

horizontally concatenates matrices.<br />

Vertically concatenate matrices. (Use ||<br />

or Concat() to horizontally<br />

concatenate matrices.)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!