Show TOC

Examples for the Assignment Operator (=)Locate this document in the navigation structure

Use

I1 = 2.

I2 = 3 * ( I1 + 1 ) / ( I1 - 1 ).

Result: I2 has the value 9.

Character Strings

C1 = 'abcd'.

C2 = 'efgh'.

C3 = C1 & C2.

Result: C3 has the value ' abcdefgh '.

C4 = C3+2(4).

Result: C4 has the value ' cdef '.

Date Specifications

Some calculations involving dates are not valid.

Dates are represented by parameters of type D, which have the format yyyymmdd (years, months, days).

A number of days can be represented by parameters of type I, P, N, or C (with numeric content).

Valid Calculations

Date shifted by a number of days:

DATE2 = DATE1 - NUMBER1.

20010823 - 10 gives 20010813

DATE2 = DATE1 + NUMBER1.

20010823 + 10 gives 20010902

Difference in days between two dates:

NUMBER1 = DATE1 - DATE2.

20010813 - 20000618 gives 421

If DATE2 is greater than DATE1, NUMBER1 is negative if type I, P, or C, but positive if type N.

Time Specifications

Some calculations involving times are not valid.

Times are represented by parameters of type T, which have the format hhmmss (hours, minutes, seconds).

A number of seconds can be represented by parameters of type I, P, N, or C (with numeric content).

Valid Calculations

Time shifted by a number of seconds:

TIME2 = TIME1 - NUMBER1.

235930 - 31 gives 235859

TIME2 = TIME1 + NUMBER1.

235930 + 31 gives 000001

Difference in seconds between two times:

NUMBER1 = TIME1 - TIME2.

104050 - 103030 gives 620

If TIME2 is greater than TIME1, TIME3 is negative if type I, P, or C, but positive if type N.