I have an ActiveX Script for a transformation in a DTS that uses lookups and global variables to get a sum total of the Employee Deferral field and then send it to a DTSDestination. When I click on the TEST button, it displays the correct totals. However, when I execute the package, the destination file contains a null in this field instead of the correct values. I don't receive any error on this. Here's the code for the script:
'**********************************************************************
' Visual Basic Transformation Script
'************************************************************************
' Copy each source column to the destination column
Function Main()
Company=DTSSource("COMPANY")
Employee=DTSSource("EMPLOYEE")
DeferralCode=DTSGlobalVariables("DeferralCode").Value
DeferralCodeCatchup=DTSGlobalVariables("DeferralCodeCatchup").Value
MatchCode=DTSGlobalVariables("MatchCode").Value
RunDateBegin=DTSGlobalVariables("RunDateBegin").Value
RunDateEnd=DTSGlobalVariables("RunDateEnd").Value
EEDeferral = DTSLookups("GetContrib").Execute(Company,Employee,DeferralCode,DeferralCodeCatchup,RunDateBegin,RunDateEnd)
DTSDestination("EEDeferral") = EEDeferral
ERMatch=DTSLookups("GetMatchContrib").Execute(Company,Employee,MatchCode,RunDateBegin,RunDateEnd)
DTSDestination("ERMatch")= ERMatch
LoanPayment=DTSLookups("GetLoanPmt").Execute(Company,Employee,RunDateBegin,RunDateEnd)
DTSDestination("LoanPayment") = LoanPayment
Main = DTSTransformStat_OK
End Function
'**********************************************************************
' Visual Basic Transformation Script
'************************************************************************
' Copy each source column to the destination column
Function Main()
Company=DTSSource("COMPANY")
Employee=DTSSource("EMPLOYEE")
DeferralCode=DTSGlobalVariables("DeferralCode").Value
DeferralCodeCatchup=DTSGlobalVariables("DeferralCodeCatchup").Value
MatchCode=DTSGlobalVariables("MatchCode").Value
RunDateBegin=DTSGlobalVariables("RunDateBegin").Value
RunDateEnd=DTSGlobalVariables("RunDateEnd").Value
EEDeferral = DTSLookups("GetContrib").Execute(Company,Employee,DeferralCode,DeferralCodeCatchup,RunDateBegin,RunDateEnd)
DTSDestination("EEDeferral") = EEDeferral
ERMatch=DTSLookups("GetMatchContrib").Execute(Company,Employee,MatchCode,RunDateBegin,RunDateEnd)
DTSDestination("ERMatch")= ERMatch
LoanPayment=DTSLookups("GetLoanPmt").Execute(Company,Employee,RunDateBegin,RunDateEnd)
DTSDestination("LoanPayment") = LoanPayment
Main = DTSTransformStat_OK
End Function