Dynamic expression in Text file Connection works when executed alone, but not when executed with package

  • I have a Foreach Loop Container that grabs today's system generated text file from a shared location, modifies the header record, loads the file to a SQL table, renames the modified text file to a static location with the proper name for upload to a secure mailbox, and should then rename the file to a dynamic archive location.

    I have these string variables:

    FileDate = YYYYMMDD

    PymtMo = Mon (i.e. Nov)

    PymtMoVar = YYYYMM

    I'm trying to get to this location:

    Fixed: S:\Datafile\DepartmentArea\Vendor\VendorFunction\VendorSubFunction\

    After this it goes to variable locations:

    PymtYear function\YYMM PymtMo function.txt

    My expression looks like this:

    "S:\\Datafile\\DepartmentArea\\Vendor\\VendorFunction\\VendorSubFunction\\" + "\\" + substring(@PymtMoVar,1,4) + " Transmissions\\" + substring(@PymtMoVar,5,2) + substring(@PymtMoVar,3,2) + " " + @PymtMo + "Pmt Transmissions\\" + @FileDate + "_EN_Transmission_" + @PymtMo + "Pmt.txt"

    I've used various variations of this expression in variables and connection strings with a Data Flow Task and a File System Task, all with the same results.

    The expression evaluates to the proper location, and when I right-click the task and "Execute Task", I get a file in the right location, but when I execute the whole package, this part always fails.

    Help?

  • I moved the Archive tasks into their own package using the same variables and now they work fine. I initiate the package with an "Execute Package Task" after the Foreach Loop Container.

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

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