Hello wise ones. I have a script that gets a file off of a mainframe. I then import the file into MSSQL using a dts package. If I run the ftp manually using dos the file imports fine. If I use the perl code I error out when I try to do the import. When I run the FTP in dos I run through all the same commands and if I open the csv in excel it looks fine. The MSSQL error sais it can't find a CR/LF in the first 8k. Any help is appreciated.
my $host1='myhost'; my $user1="user"; my $pw1="pwd"; my $path = 'MY.FILE.NAME'; my $dataFile="MY.FILE.NAME\.csv"; my $mffile = '\'MY.FILE.NAME\''; #### Pull file off mainframe #### $ftp=Net::FTP->new($host1, Debug => 1); $ftp->login($user1,$pw1) or die "could not login to $host1"; $ftp->cwd($path) or die "could not cwd $path"; # change to incoming + directory $ftp->get($mffile) or die "could not get $file";

In reply to Net::FTP seems to be corrupting my file by boat73

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.