DTS Hanging (in ActiveX Script Task when calling another DTS)

  • Our system gets feeds from a number of different vendors.  Most of the files I just grab from FTP sources.  Each file has it's own package because of all the little nuances between them.  The final task in each of the packages is to archive the source file to an archive directory, so that only "unloaded" data resides in the working directory.

    That out of the way...

    I've written another package that does a couple things.

    The first task retrieves all the files from the various FTP sites and copies the files to their appropriate working directory.  There could be at times when a vendor pushed out multiple files, so I need to account for this during the data loads.

    The second task is an ActiveX Task.  Using an FSO object, it grabs the working forlder, and while files exist in that directory, the appropriate DTS package is executed.

    This particular package handles three separate vendors.  The first two always run fine.  However, the third keeps hanging and I can't seem to figure this out.  It hangs in the ActiveX step that calls executes the "load" DTS.  The load seems to work fine, but that package never seems to archive the file, and therefore, the "while o_folder.files.count" never reaches 0, and so, the package is called over and over.  If I let this package run, and then manually move the file, it will finally terminate with "success".  Incidentally, if I execute the "load" DTS by itself, all the tasks run fine and the file is archived successfully.

    I'm at a loss on this one.  Any thoughts?

    Thanks

    Brian

     

  • Might you have a zero-based list and a 1-based loop, so that the last item never gets accessed? (or something along those lines)

    I mean, what happens if you do the last item first, do they all run, or does the new last item not run?

    Thanks,

    Metra

  • To better understand what's going on, consider the following:

    The main package has basically two different types of tasks; an Execute Process task and an ActiveX Script Task described as follows:

    Task type 1: Execute Process

      • Executes a batch file that connects to the FTP,

        downloads the files to the working directory and

        then deletes the source files on the FTP

    Task type 2: ActiveX Script Task

      • Creates a DTS Package object instance of Sub-Package (a, b or c) (see below).

      • While files exist, execute package

    Main Package Details

      Task 1: Execute Process (for vendor 1)

      Task 2: ActiveX Script (for vendor 1)

      Task 3: Execute Process (for vendor 2)

      Task 4: ActiveX Script (for vendor 2)

      Task 5: Execute Process (for vendor 3)

      Task 6: ActiveX Script (for vendor 3)

    Sub Packages (a, b & c)

      1. Looks for matching files in the working directory

      2. Dynamically sets DataSource of the file connection

         object to the new file

      3. Process File

      4. ActiveX script gets DataSource file name from Connection

         object and moves to the archive directory.

      5. Done.

    So for the main package, when it gets to task 6, sub-package c should execute, processing the file and then moving it to an archive, and therefore, the loop in Main Package :: Task 6 should complete and the package should unload.

    FYI - the loop mentioned is a While/wend loop calling a function ie:

      While getFile() <> ""

          o_dts.Execute

      Wend

    Function getFile()

      • Looks for the first matching file in the working directory

        and returns the file name.

      • If there are no matching files, then the function returns

        an empty string.

    The problem is that the file is never moved, and therefore, a file always exists, causing the o_dts.Execute line to get stuck in an idiot-loop.  I found that when the main DTS is "hanging" on task 6, if I manually move the file out of the working directory, the DTS completes with "success".

  • What happens when you do only (a or b) and c?  Meaning skip one of the first two...  Does c run then or does it still not run?

Viewing 4 posts - 1 through 3 (of 3 total)

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