Getting error in File system Task

  • Hi

    I am using file system task to create the directory,

    i set IsSourcePathVariable to true and i gave the sourcevariable name

    i have a package level variable called "ProcessedFilePath" with the value set to "C:\myvsworks\Myssis"

    in the Expression of the File system task i set the source to

    @[User::ProcessedFilePath] + "\\" + (DT_WSTR, 4)(YEAR( Getdate() )) + (DT_WSTR, 2)(MONTH( Getdate() )) + (DT_WSTR, 2)(DAY( Getdate())) + "ProcessedFile\\"

    so that the evaluated value of the above will be like

    "C:\myvsworks\Myssis\2010528ProcessedFile\" which is exactly i need the directory structure.

    when i run the package i am getting the following error:

    [File System Task] Error: An error occurred with the following error message: "Failed to lock variable "C:\myvsworks\Myssis\2010528ProcessedFile\" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.". ".

  • I believe the FileSystemTaskSource property would be the name of the source not the value of the source. My recommendation is to use your expression to set the value of the variable, then use the variable as the source:

    In the File System Task Editor (a) set IsSourcePathVariable = True ; (b) set Source Variable = User::ProcessedFilePath (select from dropdown)

    In the properties window for the ProcessedFilePath variable: (a) set EvaluateAsExpression = True; (b) set Expression = "C:\\myvsworks\\Myssis\\" + (DT_WSTR, 4)(YEAR( Getdate() )) + (DT_WSTR, 2)(MONTH( Getdate() )) + (DT_WSTR, 2)(DAY( Getdate())) + "ProcessedFile\\"

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

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