Text Data Appending

  • Hi all,

    I got 2 text files and need to transform the data into one single text file. On the first transformation, I used the following codes:

    if DTSSource("Col015") <> "000" Then

    DTSDestination("Col001") = DTSSource("Col009")

    DTSDestination("Col002") = DTSSource("Col015")

    Main = DTSTransformStat_OK

    Else

    Main = DTSTransformStat_SkipRow

    End if

    On the second transformation, I used the following codes:

    Dim objFSO, objFolder, objShell, objTextFile, objFile

    Dim strDirectory, strFile, strText

    strDirectory = "e:\mcif\woodstone"

    strFile = "\beacon-lkup.txt"

    ' Create the File System Object

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    ' Check that the strDirectory folder exists

    If objFSO.FolderExists(strDirectory) Then

    Set objFolder = objFSO.GetFolder(strDirectory)

    Else

    Set objFolder = objFSO.CreateFolder(strDirectory)

    msgbox("Just created " & strDirectory)

    End If

    If objFSO.FileExists(strDirectory & strFile) Then

    Set objFolder = objFSO.GetFolder(strDirectory)

    Else

    Set objFile = objFSO.CreateTextFile(strDirectory & strFile)

    msgbox("Just created " & strDirectory & strFile)

    End If

    set objFile = nothing

    set objFolder = nothing

    ' OpenTextFile Method needs a Const value

    ' ForAppending = 8 ForReading = 1, ForWriting = 2

    Const ForAppending = 8

    Set objTextFile = objFSO.OpenTextFile (strDirectory & strFile, ForAppending, True)

    DTSDestination("Col001") = DTSSource("Col009")

    DTSDestination("Col002") = DTSSource("Col015")

    Main = DTSTransformStat_OK

    When I tested and ran the transformations separately, they were working fine. However, when I ran the transformations together, I got 2 error messages:

    1. The Data Pump Task requires Transformations to be specified.

    2. The number of failing rows exceeds the maximum specified.

    Error Code: 0

    Error Source = Microsoft VBScript runtime error.

    Error Description: Permission denied.

    Error on Line 36

    Can anyone help? Thanks!!

  • sounds like you don't have permissions to write to the file under the credentials specified for the job.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply