use strict;
my $str = 'The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of
evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother\'s keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you wil[Table].[FieldName] Table.Field[d, d] l know My name is the Lord when I lay My vengeance upon thee.
-- Obligor Current Principal Payment Adjustment
--===============================
--This the part of the document that describe the Obligor Current Principal Payment Adjustment
--===============================
[HELOC_CS_Master].[O_CurrPrinPmtAdj] = CASE WHEN ([CSMonthlySourceView].[O_CURRPRINPMTADJ]) is not null
THEN [CSMonthlySourceView].[O_CURRPRINPMTADJ]
ELSE 0
END,
-- Obligor Current Interest Payment Adjustment
[HELOC_CS_Master].[O_CurrIntPmtAdj] = CASE WHEN ([CSMonthlySourceView].[O_CURRINTPMTADJ]) is not null
THEN [CSMonthlySourceView].[O_CURRINTPMTADJ]
ELSE 0
END,
-- Obligor Current Fee Payment Adjustment
[HELOC_CS_Master].[O_CurrFeesPmtAdj] = CASE WHEN ([CSMonthlySourceView].[O_CURRFeesPMTADJ]) is not null
THEN [CSMonthlySourceView].[O_CURRFeesPMTADJ]
ELSE 0
END,
-- Obligor Current Recovery Payment Adjustment
[HELOC_CS_Master].[O_CurrRecovPmtAdj] = CASE WHEN ([CSMonthlySourceView].[O_CURRRecovPMTADJ])is not null
THEN [CSMonthlySourceView].[O_CURRRecovPMTADJ]
ELSE 0
END,
-- Obligor Add Finance Charge Bal
[HELOC_CS_Master].[O_FCBalAdd] = [CSMonthlySourceView].[CASHINTERESTBILLEDTHISCYCLE]+[CSMonthlySourceView].[RETAILINTERESTBILLEDTHISCYCLE]
,
-- Obligor Current Additional Principal Balance
[HELOC_CS_Master].[O_PrinBalAdd] = [CSMonthlySourceView].[MONTHLYRETAILAMOUNT]
+[CSMonthlySourceView].[MONTHLYCASHAMOUNT]
+[CSMonthlySourceView].[MONTHLYCHEQUEAMOUNT],
-- O_CurrBalEnd
[HELOC_CS_Master].[O_CurrBalEnd] = [CSMonthlySourceView].[PRINBALEND_CALC]+
[CSMonthlySourceView].[FCBALEND_CALC]
------------------------------------------------------------------------------------
-- O_FCBalEnd
[HELOC_CS_Master].[O_FCBalEnd] = [CSMonthlySourceView].[FCBALEND_CALC]
------------------------------------------------------------------------------------
-- Obligor Current Installment Interest Payment
[HELOC_CS_Master].[O_CurrIntPmt] = isnull([CSMonthlySourceView].[FCBALEND_CALC],0)
+[HELOC_CS_Master].[O_FCBalAdd]
+isnull([HELOC_CS_Master].[O_CurrIntPmtAdj],0)
------------------------------------------------------------------------------------
-- Obligor Current Installment Principal Payment
[HELOC_CS_Master].[O_CurrPrinPmt] =
[CSMonthlySourceView].[O_PRINBALEND_PR]
-[HELOC_CS_Master].[O_PrinBalEnd]
+[HELOC_CS_Master].[O_PrinBalAdd]
+[HELOC_CS_Master].[O_CurrPrinPmtAdj]
------------------------------------------------------------------------------------
-- Obligor Current Total Principal Payment
[HELOC_CS_Master].[O_CurrTotPrinPmt] = [HELOC_CS_Master].[O_CurrPrinPmt],
-- Obligor Current Fee Payment
[HELOC_CS_Master].[O_CurrFeesPmt] = [HELOC_CS_Master].[O_CurrFeesPmt]
+[HELOC_CS_Master].[O_CurrFeesPmtAdj],
-- Obligor Current Recovery Payment
[HELOC_CS_Master].[O_CurrRecovPmt] = [HELOC_CS_Master].[O_RecovPrin]
+[HELOC_CS_Master].[O_RecovInt]
+[HELOC_CS_Master].[O_CurrRecovPmtAdj]
------------------------------------------------------------------------------------
-- Obligor Current Total Payment
[HELOC_CS_Master].[O_CurrTotPmt] = [HELOC_CS_Master].[O_CurrTotPrinPmt]
+[HELOC_CS_Master].[O_CurrIntPmt],
-- Investor Account Status
[HELOC_CS_Master].[S_AcctStatus] = [HELOC_CS_Master].[S_AcctStatusBeg],
-- Investor Current Balance (Beginning)
[HELOC_CS_Master].[S_InvCurrBal] = [HELOC_CS_Master].[S_CurrBalBeg],
-- Charge off Reason
[HELOC_CS_Master].[S_ChargeOffReason] = cASE WHEN [CSMonthlySourceView].[O_DONOTCHARGEOFFFLAG]=\'Y\' THEN NULL
ELSE
CASE WHEN [HELOC_CS_Master].[S_AcctStatus]=\'Active\' AND [HELOC_CS_Master].[S_InvCurrBal]>0
THEN
CASE WHEN [CSMonthlySourceView].[O_MANUALCHARGEOFFENDBALFLAG]=\'Y\'
THEN \'ManualChargeOffBeg\'
ELSE
CASE WHEN Rtrim([CSMonthlySourceView].[O_NewOrPrevChargeOff])=\'New\'
THEN [CSMonthlySourceView].[O_CHARGEOFFREASONCODE] END
END
ELSE \'PRIOR\' END
END
------------------------------------------------------------------------------------
-- Investor Charge-off Date
[HELOC_CS_Master].[S_ChargeOffDate] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus]=\'Active\' AND
( [CSMonthlySourceView].[S_CHARGEOFFDATE_PR]) is null AND
([HELOC_CS_Master].[S_ChargeOffReason] ) is not null
THEN
CASE WHEN [HELOC_CS_Master].[PCD_SALE_DATE] > [CSMonthlySourceView].[PRIOR_DATE] +1 THEN
[HELOC_CS_Master].[PCD_SALE_DATE] ELSE [CSMonthlySourceView].[PRIOR_DATE] +1 END
ELSE [CSMonthlySourceView].[S_CHARGEOFFDATE_PR]
END
------------------------------------------------------------------------------------
-- Investor Charged-off Beginning Principal Balance
[HELOC_CS_Master].[S_ChargeOffBegPrinBal] = CASE WHEN
[HELOC_CS_Master].[S_ChargeOffDate] >[CSMonthlySourceView].[PRIOR_DATE] AND
[HELOC_CS_Master].[S_ChargeOffDate] > [HELOC_CS_Master].[PCD_ACT_D]
THEN [HELOC_CS_Master].[S_InvPrinBal]
ELSE 0
END,
-- Investor Charged-off Beginning FC Balance
[HELOC_CS_Master].[S_ChargeOffBegFCBal] = CASE WHEN
[HELOC_CS_Master].[S_ChargeOffDate] > [CSMonthlySourceView].[PRIOR_DATE] AND
[HELOC_CS_Master].[S_ChargeOffDate] < [HELOC_CS_Master].[PCD_ACT_D]
THEN [HELOC_CS_Master].[S_InvFCBal]
ELSE 0
END
------------------------------------------------------------------------------------
-- Investor Charged-off Beginning Current Balance
[HELOC_CS_Master].[S_ChargeOffBegCurrBal] = [HELOC_CS_Master].[S_ChargeOffBegPrinBal] + [HELOC_CS_Master].[S_ChargeOffBegFCBal]
,
-- Investor Repurchase Reason
[HELOC_CS_Master].[S_RepurchReason] = \'1-test\'
------------------------------------------------------------------------------------
-- Investor Repurchase Reason Family
[HELOC_CS_Master].[S_RepurchReasonFamily] =
\'Family Eligible\'
------------------------------------------------------------------------------------
-- Investor Repurchase Date
[HELOC_CS_Master].[S_RepurchDate] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus]=\'Active\' AND [CSMonthlySourceView].[S_REPURCHDATE_PR] is null AND [HELOC_CS_Master].[S_REPURCHREASONFAMILY] is not null
THEN CASE WHEN [CSMonthlySourceView].[PCD_SALE_DATE]>[CSMonthlySourceView].[PRIOR_DATE]+1 THEN
[CSMonthlySourceView].[PCD_SALE_DATE] ELSE [CSMonthlySourceView].[PRIOR_DATE]+1 END
ELSE [CSMonthlySourceView].[S_REPURCHDATE_PR] END
------------------------------------------------------------------------------------
-- Investor Repurchased Beginning Principal Balance
[HELOC_CS_Master].[S_RepurchBegPrinBal] = CASE WHEN [HELOC_CS_Master].[S_RepurchDate]>[CSMonthlySourceView].[PRIOR_DATE]
AND [HELOC_CS_Master].[S_RepurchDate] <[CSMonthlySourceView].[PCD_ACT_D]
AND [HELOC_CS_Master].[S_RepurchReason]<> \'1 – Manual Repurchase For CleanUp Purchase Option\'
THEN [HELOC_CS_Master].[S_InvPrinBal]
ELSE 0 END,
-- Investor Repurchased Clean Up Beginning Principal Balance
[HELOC_CS_Master].[S_RepurchCleanUpBegPrinBal] = CASE WHEN [HELOC_CS_Master].[S_RepurchDate]>[CSMonthlySourceView].[PRIOR_DATE]
AND [HELOC_CS_Master].[S_RepurchDate] <[CSMonthlySourceView].[PCD_ACT_D]
AND [HELOC_CS_Master].[S_RepurchReason]= \'1 – Manual Repurchase For CleanUp Purchase Option\'
THEN [HELOC_CS_Master].[S_InvPrinBal]
ELSE 0 END,
-- Investor Account Status (Post Beginning Charge-offs & Repurchases)
[HELOC_CS_Master].[S_AcctStatusPBCR] = CASE WHEN [HELOC_CS_Master].[S_Acctstatus]=\'Active\'
THEN
CASE WHEN [HELOC_CS_Master].[S_ChargeoffDate]>[CSMonthlySourceView].[PRIOR_DATE]
AND [HELOC_CS_Master].[S_ChargeoffDate] <[CSMonthlySourceView].[PCD_ACT_D]
THEN \'Charge-off\'
ELSE
CASE WHEN [HELOC_CS_Master].[S_RepurchDate]>[CSMonthlySourceView].[PRIOR_DATE]
AND [HELOC_CS_Master].[S_RepurchDate] <[CSMonthlySourceView].[PCD_ACT_D]
THEN
\'Repurchased\' END
END
ELSE [HELOC_CS_Master].[S_Acctstatus]
END
------------------------------------------------------------------------------------
-- Investor Account Status
[HELOC_CS_Master].[S_AcctStatus] = [HELOC_CS_Master].[S_AcctStatusPBCR]
------------------------------------------------------------------------------------
-- Investor Principal Balance (Post Beginning Charge-offs & Repurchases)
[HELOC_CS_Master].[S_PrinBalPBCR] = [HELOC_CS_Master].[S_InvPrinBal]
-[HELOC_CS_Master].[S_RepurchBegPrinBal]
-[HELOC_CS_Master].[S_ChargeOffBegPrinBal]
-[HELOC_CS_Master].[S_RepurchCleanUpBegPrinBal],
-- Investor Principal Balance
[HELOC_CS_Master].[S_InvPrinBal] = [HELOC_CS_Master].[S_PrinBalPBCR],
-- Investor Finance Charge Balance (Post Beginning Charge-offs & Repurchases)
[HELOC_CS_Master].[S_FCBalPBCR] = [HELOC_CS_Master].[S_InvFCBal]
-[HELOC_CS_Master].[S_ChargeoffBegFCBal]
------------------------------------------------------------------------------------
-- Investor Finance Charge Balance
[HELOC_CS_Master].[S_InvFCBal] = [HELOC_CS_Master].[S_FCBalPBCR],
-- Investor Current Balance (Post Beg Charge Offs & Repurchases)
[HELOC_CS_Master].[S_CurrBalPBCR] = [HELOC_CS_Master].[S_PrinBalPBCR]+[HELOC_CS_Master].[S_FCBalPBCR]
------------------------------------------------------------------------------------
-- Investor Current Balance
[HELOC_CS_Master].[S_InvCurrBal] = [HELOC_CS_Master].[S_CurrBalPBCR],
-- Investor Additional Finance Charge Balance
[HELOC_CS_Master].[S_FCBalAdd] = [HELOC_CS_Master].[O_FCBalAdd],
-- Investor Additional Principal Balance
[HELOC_CS_Master].[S_PrinBalAdd] = [HELOC_CS_Master].[O_PrinBalAdd]
------------------------------------------------------------------------------------
-- Investor Principal Balance (Post Additional Receivables)
[HELOC_CS_Master].[S_PrinBalPAR] = [HELOC_CS_Master].[S_InvPrinBal]
+[HELOC_CS_Master].[S_PrinBalAdd]
------------------------------------------------------------------------------------
-- Investor Principal Balance
[HELOC_CS_Master].[S_InvPrinBal] = [HELOC_CS_Master].[S_PrinBalPAR]
------------------------------------------------------------------------------------
-- Investor Finance Charge Balance (Post Additional Receivables)
[HELOC_CS_Master].[S_FCBalPAR] = [HELOC_CS_Master].[S_InvFCBal]
+[HELOC_CS_Master].[S_FCBalAdd]
------------------------------------------------------------------------------------
-- Investor Finance Charge Balance
[HELOC_CS_Master].[S_InvFCBal] = [HELOC_CS_Master].[S_FCBalPAR]
------------------------------------------------------------------------------------
[HELOC_CS_Master].[S_CurrBalPAR] = [HELOC_CS_Master].[S_PrinBalPAR]+
[HELOC_CS_Master].[S_FCBalPAR]
------------------------------------------------------------------------------------
-- Investor Current Balance
[HELOC_CS_Master].[S_InvCurrBal] = [HELOC_CS_Master].[S_CurrBalPAR],
-- Investor Current Principal Payment
[HELOC_CS_Master].[S_CurrPrinPmt] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] in (\'Active\',\'Closed\')
THEN [HELOC_CS_Master].[O_CurrPrinPmt]
ELSE 0 END
------------------------------------------------------------------------------------
-- Investor Current Principal Payment
[HELOC_CS_Master].[S_CurrTotPrinPmt] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] in (\'Active\',\'Closed\')
THEN [HELOC_CS_Master].[S_CurrPrinPmt]
ELSE 0 END,
-- Investor Current Excess Principal Payment
[HELOC_CS_Master].[S_CurrExcessPrinPmt] = CASE WHEN [HELOC_CS_Master].[S_CurrTotPrinPmt]-[HELOC_CS_Master].[S_InvPrinBal]<0 THEN 0 ELSE
[HELOC_CS_Master].[S_CurrTotPrinPmt]-[HELOC_CS_Master].[S_InvPrinBal] END,
-- Investor Current Excess Principal Payment Used
[HELOC_CS_Master].[S_CurrExcessPrinPmtUsed] = CASE WHEN -1*(CASE WHEN [HELOC_CS_Master].[S_CurrTotPrinPmt]>0 THEN 0 ELSE [HELOC_CS_Master].[S_CurrTotPrinPmt] END)<[HELOC_CS_Master].[S_BegExcessPrinBal] THEN -1*(CASE WHEN [HELOC_CS_Master].[S_CurrTotPrinPmt]>0 THEN 0 ELSE [HELOC_CS_Master].[S_CurrTotPrinPmt] END) ELSE [HELOC_CS_Master].[S_BegExcessPrinBal] END
------------------------------------------------------------------------------------
-- Investor Current Principal Payment Post Excess
[HELOC_CS_Master].[S_CurrPrinPmtPostExcess] = CASE WHEN 1=1 THEN [HELOC_CS_Master].[S_CurrPrinPmt]
ELSE
[HELOC_CS_Master].[S_CurrPrinPmt]
-[HELOC_CS_Master].[S_CurrExcessPrinPmt]
+[HELOC_CS_Master].[S_CurrExcessPrinPmtUsed] END,
-- Investor Current Fee Payment
[HELOC_CS_Master].[S_CurrFeePmt] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] in (\'Active\',\'Closed\',\'Charged-off\')
THEN [HELOC_CS_Master].[O_CurrFeesPmt]
ELSE 0 END
------------------------------------------------------------------------------------
-- S_CurrTotPrinPmt
[HELOC_CS_Master].[S_CurrTotPrinPmt] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] in (\'Active\',\'Closed\')
THEN [HELOC_CS_Master].[S_CurrPrinPmtPostExcess]
ELSE 0 END,
-- Investor Current Total Fee Pmt
[HELOC_CS_Master].[S_CurrTotFeePmt] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] in (\'Active\',\'Closed\')
THEN [HELOC_CS_Master].[S_CurrFeePmt]
ELSE 0 END,
-- Investor Current Recovery Payment
[HELOC_CS_Master].[S_CurrRecovPmt] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] =\'Charged-off\'
THEN [HELOC_CS_Master].[O_CurrRecovPmt]
ELSE 0 END
------------------------------------------------------------------------------------
-- Investor Current Recovery Payment
[HELOC_CS_Master].[S_CurrTotRecovPmt] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] =\'Charged-off\'
THEN [HELOC_CS_Master].[S_CurrRecovPmt]
ELSE 0 END
------------------------------------------------------------------------------------
-- Investor Current Excess Recovery payment
[HELOC_CS_Master].[S_CurrExcessRecovPmt] = CASE WHEN [HELOC_CS_Master].[S_CurrTotRecovPmt]-[HELOC_CS_Master].[S_BegChargeOffBal]<0 THEN 0 ELSE
[HELOC_CS_Master].[S_CurrTotRecovPmt]-[HELOC_CS_Master].[S_BegChargeOffBal] END
------------------------------------------------------------------------------------
-- Investor Current Excess Recovery payment
[HELOC_CS_Master].[S_CurrExcessRecovPmtUsed] = CASE WHEN -1*(CASE WHEN [HELOC_CS_Master].[S_CurrTotRecovPmt]>0 THEN 0 ELSE [HELOC_CS_Master].[S_CurrTotRecovPmt] END)<[HELOC_CS_Master].[S_BegExcessRecovBal] THEN
-1*(CASE WHEN [HELOC_CS_Master].[S_CurrTotRecovPmt]>0 THEN 0 ELSE [HELOC_CS_Master].[S_CurrTotRecovPmt] END)
ELSE [HELOC_CS_Master].[S_BegExcessRecovBal] END
------------------------------------------------------------------------------------
-- Investor Current Total Recovery Payment
[HELOC_CS_Master].[S_CurrTotRecovPmt] = CASE WHEN 1=1 THEN [HELOC_CS_Master].[S_CurrTotRecovPmt]
ELSE
[HELOC_CS_Master].[S_CurrTotRecovPmt]
-[HELOC_CS_Master].[S_CurrExcessRecovPmt]
+[HELOC_CS_Master].[S_CurrExcessRecovPmtUsed] END,
-- Investor Current Interest Payment
[HELOC_CS_Master].[S_CurrIntPmt] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] in (\'Active\',\'Closed\',\'Repurchased\')
THEN [HELOC_CS_Master].[O_CurrIntPmt]
ELSE 0 END
------------------------------------------------------------------------------------
-- Investor Current Excess Interest Payment
[HELOC_CS_Master].[S_CurrExcessIntPmt] = CASE WHEN [HELOC_CS_Master].[S_CurrIntPmt]-[HELOC_CS_Master].[S_InvFCBal]<0 THEN 0 ELSE
[HELOC_CS_Master].[S_CurrIntPmt]-[HELOC_CS_Master].[S_InvFCBal] END
------------------------------------------------------------------------------------
-- Investor Current Excess Interest Payment Used
[HELOC_CS_Master].[S_CurrExcessIntPmtUsed] = CASE WHEN -1*(CASE WHEN [HELOC_CS_Master].[S_CurrIntPmt]>0 THEN 0 ELSE [HELOC_CS_Master].[S_CurrIntPmt]END)<[HELOC_CS_Master].[S_BegExcessFCBal] THEN
-1*(CASE WHEN [HELOC_CS_Master].[S_CurrIntPmt]>0 THEN 0 ELSE [HELOC_CS_Master].[S_CurrIntPmt]END)
ELSE [HELOC_CS_Master].[S_BegExcessFCBal] END
------------------------------------------------------------------------------------
-- Investor Current Interest Payment Post Excess
[HELOC_CS_Master].[S_CurrIntPmtPostExcess] = CASE WHEN 1=1 THEN [HELOC_CS_Master].[S_CurrIntPmt]
ELSE
[HELOC_CS_Master].[S_CurrIntPmt]
-[HELOC_CS_Master].[S_CurrExcessIntPmt]
+[HELOC_CS_Master].[S_CurrExcessIntPmtUsed] END
------------------------------------------------------------------------------------
-- Investor Current Interest Payment Post Excess
[HELOC_CS_Master].[S_CurrTotIntPmt] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] in (\'Active\',\'Closed\',\'Repurchased\')
THEN [HELOC_CS_Master].[S_CurrIntPmt]
ELSE 0 END
------------------------------------------------------------------------------------
-- Investor Current Total Cash Payment
[HELOC_CS_Master].[S_CurrTotCashPmt] = [HELOC_CS_Master].[S_CurrTotPrinPmt]
+[HELOC_CS_Master].[S_CurrTotIntPmt]
+[HELOC_CS_Master].[S_CurrFeePmt]
+[HELOC_CS_Master].[S_CurrTotRecovPmt],
-- Account Status (Post Investor Payment)
[HELOC_CS_Master].[S_AcctStatusPIP] = [HELOC_CS_Master].[S_AcctStatus]
------------------------------------------------------------------------------------
-- Account Status (Post Investor Payment)
[HELOC_CS_Master].[S_AcctStatus] = [HELOC_CS_Master].[S_AcctStatusPIP],
-- Investor Principal Balance (Post Investor Payment)
[HELOC_CS_Master].[S_PrinBalPIP] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] in (\'Active\',\'Closed\')
THEN [HELOC_CS_Master].[S_InvPrinBal]-[HELOC_CS_Master].[S_CurrTotPrinPmt]
ELSE [HELOC_CS_Master].[S_InvPrinBal] END
------------------------------------------------------------------------------------
-- Investor Principal Balance
[HELOC_CS_Master].[S_InvPrinBal] = [HELOC_CS_Master].[S_PrinBalPIP]
------------------------------------------------------------------------------------
-- Investor Finance Charge Balance (Post Investor Payment)
[HELOC_CS_Master].[S_FCBalPIP] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] in (\'Active\',\'Closed\',\'Repurchased\')
THEN [HELOC_CS_Master].[S_InvFCBal]- [HELOC_CS_Master].[S_CurrTOtIntPmt]
ELSE [HELOC_CS_Master].[S_InvFCBal] END
------------------------------------------------------------------------------------
-- Investor Finance Charge Balance
[HELOC_CS_Master].[S_InvFCBal] = [HELOC_CS_Master].[S_FCBalPIP]
------------------------------------------------------------------------------------
-- Investor Current Balance (Post Investor Payment)
[HELOC_CS_Master].[S_CurrBalPIP] = [HELOC_CS_Master].[S_PrinBalPIP]+[HELOC_CS_Master].[S_FCBalPIP]
------------------------------------------------------------------------------------
-- Investor Current Balance
[HELOC_CS_Master].[S_InvCurrBal] = [HELOC_CS_Master].[S_CurrBalPIP]
------------------------------------------------------------------------------------
-- Investor Closed Date
[HELOC_CS_Master].[S_ClosedDate] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus] =\'Active\' AND [HELOC_CS_Master].[S_InvCurrBal]=0 AND [CSMonthlySourceView].[S_INVCURRBAL_PR]=0 AND
[HELOC_CS_Master].[O_CLFixed]=0 AND [CSMonthlySourceView].[O_CLFixed_PR]=0
OR ([HELOC_CS_Master].[O_OnRiskFileFlag] is null AND [HELOC_CS_Master].[O_CLFixed]>0)
THEN [CSMonthlySourceView].[PCD_ACT_D]
ELSE CASE WHEN [HELOC_CS_Master].[S_AcctStatus] =\'Closed\'AND
([HELOC_CS_Master].[S_InvCurrBal]>0 OR [HELOC_CS_Master].[S_CurrTotPrinPmt]>0 OR[HELOC_CS_Master].[S_CurrTotIntPmt]>0) THEN NULL
ELSE [CSMonthlySourceView].[S_CLOSEDDATE_PR]
END
END
------------------------------------------------------------------------------------
-- NBR of Conseq Months Account Closed
[HELOC_CS_Master].[S_ClosedDateMonths] = CASE WHEN [HELOC_CS_Master].[S_ClosedDate] is null THEN 0
ELSE [CSMonthlySourceView].[S_CLOSEDDATEMONTHS_PR]+1 END
------------------------------------------------------------------------------------
-- Investor Account Status (Ending)
[HELOC_CS_Master].[S_AcctStatusEnd] = CASE WHEN [HELOC_CS_Master].[S_ClosedDate] =[HELOC_CS_Master].[PCD_ACT_D]
THEN \'Closed\'
ELSE CASE WHEN [HELOC_CS_Master].[S_AcctStatus]=\'Closed\' and [HELOC_CS_Master].[S_INvPrinBal]>0
THEN\'Active\' ELSE [HELOC_CS_Master].[S_AcctStatus]
END END
------------------------------------------------------------------------------------
-- Investor Account Status
[HELOC_CS_Master].[S_AcctStatus] = [HELOC_CS_Master].[S_AcctStatusEnd]
------------------------------------------------------------------------------------
-- Investor Principal Balance (Ending)
[HELOC_CS_Master].[S_PrinBalEnd] = [HELOC_CS_Master].[S_InvPrinBal]
------------------------------------------------------------------------------------
-- Investor Principal Balance
[HELOC_CS_Master].[S_InvPrinBal] = [HELOC_CS_Master].[S_PrinbalEnd]
------------------------------------------------------------------------------------
-- Investor Finance Charge Balance (Ending)
[HELOC_CS_Master].[S_FCBalEnd] = [HELOC_CS_Master].[S_InvFCBal]
------------------------------------------------------------------------------------
-- Investor Finance Charge Balance
[HELOC_CS_Master].[S_InvFCBal] = [HELOC_CS_Master].[S_FCBalEnd]
------------------------------------------------------------------------------------
-- Investor Ending Charge-off Balance
[HELOC_CS_Master].[S_EndChargeOffBal] = [HELOC_CS_Master].[S_BegChargeOffBal]
+[HELOC_CS_Master].[S_CurrChargeOffPrinAmt]
-[HELOC_CS_Master].[S_CurrTotRecovPmt]
------------------------------------------------------------------------------------
-- Investor Ending Excess Principal Balance
[HELOC_CS_Master].[S_EndExcessPrinBal] = [HELOC_CS_Master].[S_BegExcessPrinBal]
+[HELOC_CS_Master].[S_CurrExcessPrinPmt]
-[HELOC_CS_Master].[S_CurrExcessPrinPmtUsed],
-- Investor Ending Excess Finance Charge Balance
[HELOC_CS_Master].[S_EndExcessFCBal] = [HELOC_CS_Master].[S_BegExcessFCBal]
+[HELOC_CS_Master].[S_CurrExcessIntPmt]
-[HELOC_CS_Master].[S_CurrExcessIntPmtUsed],
-- Investor Ending Excess Recovery Balance
[HELOC_CS_Master].[S_EndExcessRecovBal] = [HELOC_CS_Master].[S_BegExcessRecovBal]
+[HELOC_CS_Master].[S_CurrExcessRecovPmt]
-[HELOC_CS_Master].[S_CurrExcessRecovPmtUsed],
-- Investor Current Balance (Ending)
[HELOC_CS_Master].[S_CurrBalEnd] = [HELOC_CS_Master].[S_PrinBalEnd]
+[HELOC_CS_Master].[S_FCBalEnd],
[HELOC_CS_Master].[S_PrinBalEndVar] = [HELOC_CS_Master].[S_PrinBalEnd]
-[HELOC_CS_Master].[O_PrinBalEnd],
-- Investor Finance Charge Balance Variance (Ending)
[HELOC_CS_Master].[S_FCBalEndVar] = [HELOC_CS_Master].[S_FCBalEnd]
-[HELOC_CS_Master].[O_FCBalEnd],
-- Investor Current Balance Variance (Ending)
[HELOC_CS_Master].[S_CurrBalEndVar] = [HELOC_CS_Master].[S_CurrBalEnd]
-[HELOC_CS_Master].[O_CurrBalEnd]
------------------------------------------------------------------------------------
-- Investor Beg and End Acctstatus Change
[HELOC_CS_Master].[S_AcctStatusChanged] = CASE WHEN [HELOC_CS_Master].[S_AcctStatusBeg] <>[HELOC_CS_Master].[S_AcctStatusEnd]
THEN \'Y\' ELSE \'N\' END,
-- Investor Out of Deal Date
[HELOC_CS_Master].[S_OutOfDealDate] = CASE WHEN [HELOC_CS_Master].[S_RepurchDate]>[CSMonthlySourceView].[PRIOR_DATE]
AND [HELOC_CS_Master].[S_RepurchDate]<=[CSMonthlySourceView].[PCD_ACT_D]
THEN [HELOC_CS_Master].[S_RepurchDate]
ELSE[CSMonthlySourceView].[S_OUTOFDEALDATE_PR] END,
-- Delinquency Bucket
[HELOC_CS_Master].[O_DelinqBucket] = CASE WHEN [CSMonthlySourceView].[DAYSDELINQUENT]>=0 AND [CSMonthlySourceView].[DAYSDELINQUENT]<=29 THEN \'0-29\'
WHEN [CSMonthlySourceView].[DAYSDELINQUENT]>=30 AND [CSMonthlySourceView].[DAYSDELINQUENT]<=89 THEN \'30-89\'
WHEN [CSMonthlySourceView].[DAYSDELINQUENT]>=90 AND [CSMonthlySourceView].[DAYSDELINQUENT]<=209 THEN \'90-209\'
WHEN [CSMonthlySourceView].[DAYSDELINQUENT]>=210 THEN \'>=210\'
ELSE NULL END
------------------------------------------------------------------------------------
-- Delinquency 0-29 Balance
[HELOC_CS_Master].[O_Delinq0to29Bal] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus]=\'Active\' AND [HELOC_CS_Master].[O_DelinqBucket]=\'0-29\'
THEN [HELOC_CS_Master].[S_InvPrinBal] ELSE 0 END,
-- Delinquency 30-89 Balance
[HELOC_CS_Master].[O_Delinq30to89Bal] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus]=\'Active\' AND [HELOC_CS_Master].[O_DelinqBucket]=\'30-89\'
THEN [HELOC_CS_Master].[S_InvPrinBal] ELSE 0 END,
-- Delinquency 90-209 Balance
[HELOC_CS_Master].[O_Delinq90to209Bal] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus]=\'Active\' AND [HELOC_CS_Master].[O_DelinqBucket]=\'90-209\'
THEN [HELOC_CS_Master].[S_InvPrinBal] ELSE 0 END,
-- Delinquency GT 210 Balance
[HELOC_CS_Master].[O_DelinqGT210Bal] = CASE WHEN [HELOC_CS_Master].[S_AcctStatus]=\'Active\' AND [HELOC_CS_Master].[O_DelinqBucket]=\'>=210\'
THEN [HELOC_CS_Master].[S_InvPrinBal] ELSE 0 END,
-- PCD_SALE_DATE
[HELOC_CS_Master].[PCD_SALE_DATE] = [CSMonthlySourceView].[PCD_SALE_DATE],
-- PCD_SALE_ID
[HELOC_CS_Master].[PCD_SALE_ID] = [CSMonthlySourceView].[PCD_SALE_ID]
';
my $regex = qr/(\[\w+])(?:\.\([\w+])*/imp;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html