Find the answer to your Linux question:
Results 1 to 6 of 6
Hello: I was wondering if someone can help me out with a FTP issue I have a batch process setup that uploads data from my linux server to a mainframe. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    7

    FTP Issue Linux to Mainframe


    Hello:

    I was wondering if someone can help me out with a FTP issue I have a batch process setup that uploads data from my linux server to a mainframe. The data that I am uploading contains special char which are uploading incorrectly.

    The chars I am uploading are: 不明

    When the file lands on the mainframe it turns into: ??

    Below is the current local char set:
    echo $LANG
    en_US.UTF-8

    Below is the LFTP command I am using:
    lftp $MAINFRAME <<-EOFtp
    user FTPDXXX XXXX4MF
    debug -o $logfile
    site sbd=(IBM-037,ISO8859-1)
    site LRECL=$reclength
    set ftp:ssl-protect-data true
    put -a ${filepath}${linuxfile} -o $mffile
    set ftp:ssl-protect-data false
    quit
    EOFtp

    Here is the data on the mainframe in HEX(post upload):
    period.unknown =??
    9898984A9999A9476604
    759964B45256650EFFD0
    My goal is to be able to transfer the file to the mainframe with the charset resembling the charset on the linux server....

    Just a FYI... I have swapped code pages and have had no luck... maybe I didnt try enough combinations but if someone could help that would be greatly appreciated. Thank you

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,753
    I assume you are transferring the data as ASCII and not BINARY. That is probably the source of the problem.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jun 2010
    Posts
    7
    Nope it didnt work.... after looking at the man page I saw that the default for a LFTP put was BINARY so I changed the put statement to:
    lftp $MAINFRAME <<-EOFtp
    user FTPDXXX XXXX4MF
    debug -o $logfile
    site sbd=(IBM-037,ISO8859-1)
    site LRECL=$reclength
    set ftp:ssl-protect-data true
    put ${filepath}${linuxfile} -o $mffile
    set ftp:ssl-protect-data false
    quit
    EOFtp
    The result on the mainframe was file with no readable text.
    EDIT TEST.UPLOAD.FILE Columns 00001 00072
    Command ===> Scroll ===> CSR
    ****** ***************************** Top of Data ******************************
    000001
    000002 / % > ?_/ /
    000003 ?>?ˬ:Ǭ. ?
    000004
    000005 > /* +*%/**%/?>?ˬ:Ǭ. ? *


    Thanks for the try.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,753
    Why not gzip the data into a .gz file and transfer that as binary data?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    Jun 2010
    Posts
    7
    I still need a ASCII to EBCDIC conversion which the FTP transfer is supposed to be doing.... If I zipped the file on the linux server and transfered it as is I would loose that conversion.... I have also tried ICONV (iconv -f utf-8 -t iso8859-1 input.txt > output.txt) yet that blows up with an error of iconv: illegal input sequence.

  7. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,753
    Ah. I didn't realize that you needed to get an ascii to ebcdic conversion. That's not something I've had to deal with for FTP transfers. It may be that the characters in question do not have a responding character in ebcdic, resulting in the symbols you are seeing.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •