Create MD5 Check file

  • Hello All,

    I have an SSIS package that exports data to a file which is then placed on the FTP site of a vendor. They have asked me to send along a "Control File" as well. On their side, they will "run the command line md5sum hash" on the file they receive and check it to be sure it is the same as the file I uploaded to their FTP.

    I'm completely at a loss for what I need to do and they've been less than helpful, or I've not asked them the right questions. This is what I got from them when I asked for more info on how we would accomplish and steps:

    The control file name should be the same as the data file with a ctl extension rather than a dat extension.

    The contents of the file should contain the following lines.

    BEGIN

    file_md5sum

    0x9ee70e396b2e3ef615d67a31bfe375a8 * oms-pms-res-snap-20110522-20110521103322.dat

    END

    (where the Bold info should match the file name used to generate the hash value)

    Could someone outline how this is accomplished, it must be 'normal' but I can't find anything that makes any sense on the web (again, I may not be googling the right phrase).

  • I haven't had to do this before, but here are some bits I knocked up to try and help...

    First, grab a copy of md5sum.exe from the Unix Utils project : http://sourceforge.net/projects/unxutils/files/unxutils/current/UnxUtils.zip/download

    Next, make a simple batch file to make life easier. Call it MakeMd5.bat or whatever you like...

    Put some code in the batch file to prime your .ctl file and to call md5sum.exe on your file to generate the hash.

    cd /D "%~dp1"

    echo BEGIN > "%~n1".ctl

    echo file_md5sum >>"%~n1".ctl

    "%~dp0\md5sum.exe" %~nx1 >>"%~n1".ctl

    echo END >>"%~n1".ctl

    cd /D "%~dp0"

    Pop the batch file and md5sum.exe in a folder on your SSIS server and then you can call the batch file, passing it the name of your data file and it will create the .ctl file for it.

    This is a very simple example with no error handling so you may need to tweak it a bit....

    You can call the batch file from SSIS using an execute process task.

    MM



    select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);

  • Forum Etiquette: How to post Reporting Services problems
  • [/url]
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • [/url]
  • How to Post Performance Problems - by Gail Shaw
  • [/url]

  • THANK YOU! This worked like a dream with a few tweaks specific to our environment. Placed in an execute process task in SSIS referencing the .bat file (and passing the file's name as a variable) and voila!

    ~angelnjj

  • angelnjj (9/21/2011)


    THANK YOU! This worked like a dream with a few tweaks specific to our environment. Placed in an execute process task in SSIS referencing the .bat file (and passing the file's name as a variable) and voila!

    ~angelnjj

    Great news, and thanks for the feedback!

    MM



    select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);

  • Forum Etiquette: How to post Reporting Services problems
  • [/url]
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • [/url]
  • How to Post Performance Problems - by Gail Shaw
  • [/url]

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

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