* P2K_CF_WAGE_RATE\\ 
* P2K_CF_PREMIUM\\  

These custom functions have been created to be used with UserCalcs which allow us to determine an employee's wage rate and premium rate based on dates defined in the UserCalc. These new functions are defined in the lexicon 'X_UC_FUNCTIONS'.  If the functions are not listed in X_UC_FUNCTIONS lexicon, they can be manually added to the lexicon in [IMLN] 

The function 'P2K_CF_WAGE_RATE' will pass the wage rate from the employee's assignment as of the date found in the Global Variable 'CF WAGE DATE'.  

The function 'P2K_CF_PREMIUM' will pass the value of an employee's premium from their assignment as of the date found in the Global Variable 'CF PREMIUM DATE' and for the premium type defined in the Global Variable 'CF PREMIUM TYPE'.

These calculations are based on the employee's Prime Assignment only.

The Global Variables must be named and created exactly as shown below:\\
CF PREMIUM DATE  - this is a 'DATE' type global variable\\
CF PREMIUM TYPE - this is a 'CHAR' type global variable\\
CF WAGE DATE - this is a 'DATE' type global variable\\


!!Sample User Calculation
Global Variables are needed to invoke the new custom function logic available in UserCalcs.  They must be named exactly as shown below:\\
*  CF WAGE DATE\\ 
*  CF PREMIUM DATE\\ 
*  CF PREMIUM TYPE

Usercalc Example:  Capture wage rate and premium rate as of pay issue date\\
The following UserCalc was written to capture the employee's wage rate and premium rates as per the Pay Issue Date and return the combined amounts to be used in the benefit calculation.  This is a 'Function' type UserCalc and will return the value of the wage rate plus premium rate to the appropriate benefit component.

||LINE||CMD ||TYPE 1||OPERAND 1      || OPER||TYPE 2||OPERAND 2  || TYPE 3||OPERAND 3||IF GO TO||ELSE GO TO||NOTES        ||
| 100  | LET |  $G    |CF WAGE DATE|  EQ |   DB   |  PPH.PAY_ISSUE_DATE|        |           |   110   |     |              |
| 110  | LET |  V     |BASE WAGE   |  EQ |   CF   |  P2K_CF_WAGE_RATE  |        |           |   200   |     |              |
| 200  | LET |  $G    |CF PREMIUM DATE|EQ|   DB   |  PPH.PAY_ISSUE_DATE|        |           |   210   |     |              |
| 210  | LET |  $G    |CF PREMIUM TYPE|EQ|   A    |  CCR REG           |        |           |   220   |     |            |  
| 220  | LET |  V     |CCR            |EQ|   CF   |  P2K_CF_PREMIUM    |        |           |   300   |     |              |
| 300  | LET |  $G    |CF PREMIUM DATE|EQ|   DB   |  PPH.PAY_ISSUE_DATE|        |           |   310   |     |              |
| 310  | LET |  $G    |CF PREMIUM TYPE|EQ|   A    |  CORR_ASSIGN       |        |           |   320   |     |              |
| 320  | LET |  V     |CORR ASSIGN    |EQ|   CF   |  P2K_CF_PREMIUM    |        |           |   400   |     |              |
| 400  | LET |  $G    |CF PREMIUM DATE|EQ|   DB   |  PPH.PAY_ISSUE_DATE|        |           |   410   |     |              |
| 410  | LET |  $G    |CF PREMIUM TYPE|EQ|   A    |  HPL               |        |           |   420   |     |              |
| 420  | LET |  V     |HPL            |EQ|   CF   |  P2K_CF_PREMIUM    |        |           |   500   |     |              |
| 500  | LET |  $G    |CF PREMIUM DATE|EQ|   DB   |  PPH.PAY_ISSUE_DATE|        |           |   510   |     |              |
| 510  | LET |  $G    |CF PREMIUM TYPE|EQ|   A    |  LPL               |        |           |   520   |     |              |
| 520  | LET |  V     |LPL            |EQ|   CF   |  P2K_CF_PREMIUM    |        |           |   600   |     |              |
| 600  | LET |  V     |BENEFIT WAGE   |ADD|  V    |  BASE WAGE         |   V    |CCR        |   610   |     |              |
| 610  | LET |  V     |BENEFIT WAGE   |ADD|  V    |  BENEFIT WAGE      |   V    |CORR ASSIGN|   620   |     |              |
| 620  | LET |  V     |BENEFIT WAGE   |ADD|  V    |  BENEFIT WAGE      |   V    |HPL        |   630   |     |              |
| 630  | LET |  V     |BENEFIT WAGE   |ADD|  V    |  BENEFIT WAGE      |   V    |LPL        | 99999   |     |              |
|99999 | RET |  V     |BENEFIT WAGE   |