Using dos Copy to merge files through DTS not working

  • I have a job that does a Transform Data Task to a Text File (Export) to produce two CSV text files, one contains a single header record and is exported to a .CSV extension, the other contains all the detail records and is exported in a CSV format to a file with the extension of .Detail.  It's two discrete steps that both On Completion feed an Execute Process Task to invoke cmd.exe with the following parameter line:

    /c "copy c:\AZSCHMEMBERSHIPvvvvvvv.csv+c:\AZSCHMEMBERSHIPvvvvvvv.Detail"

    If this line is typed at a command prompt, it merges the .Detail record into the .CSV file.

    If run via DTS, it doesn't merge, it doesn't matter if I'm running it from the package designer or from the DTS package list.  I haven't tried running it as a scheduled task, but I have no reason to believe that it would behave any differently.

    Now here's the peculiar part -- when I first started creating these jobs, IT WORKED.  NOW IT DOESN'T.  It's driving me nuts trying various permutations and combinations, such as explicitly pathing the location of cmd.exe, to try to make it work again.

     

    Any suggestions?

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

  • May be the path where the cmd is executed, try specifying the destination:

    /c "copy c:\AZSCHMEMBERSHIPvvvvvvv.csv+c:\AZSCHMEMBERSHIPvvvvvvv.Detail c:\AZSCHMEMBERSHIPvvvvvvv.csv"

     

  • Grrr.  Thanks for pointing out my ritual idiocy.   I have a lot of fun here at work, occasionally letting out a "What a maroon!" or other self-deprecating slur.  I love the looks I get!

    I don't know how long I've spent looking at the Dos Help screen, and my mind just kept blanking over the output parameter.  As a slim justification, it seems like I did this a long time ago in true Dos days and I didn't need the destination as long as it was two files being merged.

    Thanks again!  You've saved me an awful lot of grief.  All is working well now.

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

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

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