0 Replies Latest reply on Apr 10, 2015 10:44 AM by Rose Fiorito

    P0057 is not pulling the correct value

    Rose Fiorito
    Visibility: Open to anyone

      0 Replies Latest reply: Apr 10, 2015 3:52 PM by Fiorito Rose RSS

       

       

      Hi. Here is the situation. We are using function P0057 to calculate/bring in the appropriate value for our union dues. Our rule starts off as: 

       

      000010            D VWTCL 76

      000020 *          D VAKEYPAYTY

      000030 * *        Z GCY )I5A

      000040 * A

      000050 * B

      000060 1          D VAKEYPAYTY

      000070 1 *

      000080 1 A        Z GCY )I5A

      000090 1 B

      000100 2          D VAKEYPAYTY

      000110 2 *        Z GCY )I5A

      000120 2 A        Z GCY )I5A

      000130 2 B

       

      000010              AMT= BETRGNUM= ANZHLNEXTR

      000020          1 D VAKEYMEMBS

      000030 ****         %CTC EMFSLKSETI T=STOPIND     ADDWT *

      000040 9001         TABLEP0057%CTC EMFSLKSETI T=STOPIND     ADDWT *    "CHARITY

      000050 9002       Z TABLEP0057PAYTP P                                  "PEN.DIST

      000060 9003       Z TABLEP0057PAYTP A                                  "UD ADJ.

      000070 CAUN       Z TABLEP0057PAYTP U                                "UNION DUES

      000080 CLUB       D AMT?0

      000090 CLUB *       NUM=1     VALBS0    ZERO= NR  NEXTR 1    "1/4CLUB

      000100 CLUB *   1   TABLEP0057%CTC EMFSLKSETI T=STOPIND     ADDWT *

      000110 CLUB >       TABLEP0057%CTC EMFSLKSETI T=STOPIND     ADDWT *    "MEMBERSHP

      PAYTPU

      000010            D OUTWPPERSG                               "PENSIONER VS. OTHER

      000020 *          D OUTWPPERSB                               "TRADES OR OTHERS

      000030 * **       D AMT= BETRGAMT?0

      000040 * ** *       OPIND     ADDWT *

      000050 * ** =       NUM=1     VALBS0    ZERO= NR  OPIND     ADDWT *

      000060 * AF         NUM=1     WGTYP=0102%CTW EMFSLNEXTR 1    "2504.RTE=TWP

      000070 * AF     1   WGTYP=*   ADDWT *   NEXTR 2

      000080 * AF     2 D WGTYP=###APLOOP 26  %CTW EMFSLMULTI NRA AMT?0

      000090 * AF *       WGTYP+###1PLOOP END

      000100 * AF >       TABLEP0057%CTC EMFSLKSETI T=STOPIND     ADDWT *   NEXTR 1

      000110 * AF >   1   WGTYP+###1PLOOP END

      000120 C          D AMT= BETRGAMT?0

      000130 C *          OPIND     VALBS=2   ADDWT *              "ADD TO WT2501

      000140 C =          NUM=1     VALBS0    ZERO= NR  NEXTR 1    "READ FROM T510J

      000150 C =      1 D AMT-CY*   AMT?0                          "REACHED ANNUAL CAP?

      000160 C = *                                                 "YES, DO NOT SAVE

      000170 C = >        OPIND     VALBS=2   ADDWT *              "NOT YET, ADD 2501

       

      Our problem is that when we have a split that comes through, the system brings in the split:

       

      Table P0057

      From        To          Membership      Text                                      Recipient  Memb.amount    Currency

      2014.05.26  2014.09.26  CAUN            Union for Canada                          HH                  0.00  CAD
      2014.09.29  9999.12.31  CAUN            Union for Canada                                                  0.00  CAD

       

      Result:

      2504 Trades Union Dues
      Rule   ESGPCR VaKey    Operation

      )I57      *            VWTCL 76
      )I57      *   *        VAKEYPAYTY
      )I57      *   * *      GCY )I5A
      )I5A      *            AMT= BETRG
      )I5A      *            NUM= ANZHL
      )I5A      *            VAKEYMEMBS
      )I5A      *   CAUN     TABLEP0057
      )I5A      *   CAUN     PAYTP U
      )I5A      U            OUTWPPERSG
      )I5A      U   *        TABLEWPBP
      )I5A      U   *        OUTWPPERSB
      )I5A      U   * **     AMT= BETRG
      )I5A      U   * **     AMT?0
      )I5A      U   * ** =   NUM=1
      )I5A      U   * ** =   VALBS0
      )I5A      U   * ** =   ZERO= NR
      )I5A      U   * ** =   OPIND
      )I5A      U   * ** =   ADDWT *

       

      The problem is that I am expecting to find the system to come through for OUTWPPERSB as 'AF' but it seems that it is finding '**' instead which is what the employee is at the end of the pay period. Is there something in our rule that needs to be changed for the system to find exactly where the employee is at the time span of each of the splits?

       

      If anyone has an answer, I would appreciate it immensely.

       

      Thank you.