YBT - Years Between #

This operator takes the years between Operand 2 and Operand 3, and stores the result in Operand 1. The value stored in Operand 1 will be either a positive or negative value.

The number of years returned will be expressed as a whole number.

Statement
If an employee has worked for the company for more than 20 years as of January 1, and their anniversary is this pay, give a $1000 bonus and store the bonus in PC 980.

LineCMDOTOperand 1OPEROTOperand2OTOperand3If Goto Else GoTo
00010 LETVJAN 1 OF THIS YEARBY$SPERIOD-END-DATE 00020
00020 LETVYRS SERVICE AS OF JAN 1YBTDBEEM.HIRE_DATEVJAN 1 OF THIS YEAR00030
00030 ANN BDDBEEM.HIRE_DATE 001009999
00100 LETPC980EQN1000 99999
99999EXIT 99999

Line 00010 The beginning of the year is calculated to prevent having to maintain the UserCalc when the year changes.
Line 00020 The years of service are calculated based on January 1.
Line 00030 Determined if the current pay period includes the anniversary of the employee’s hire date.

In the example above, if the period end date is June 15, 2000 and the employee’s hire date is June 10, 1979, the employee would receive the $1000.00 bonus during this pay. The number of years will be expressed in fractional numbers.


Notes #

Click to create a new notes page