Results 1 to 2 of 2

Thread: Need help to read file from mainframe

  1. #1

    Default Need help to read file from mainframe


    I managed to 'ftp get' a file in ascii from mainframe. but the problem is the data comes in 1 line, there is no carriage returns or line feeds.

    Can someone please help in either:

    1. giving an idea as to how to read that one line, break that line at say 700 characters, create a file of multiple lines of 700 characters. I can then use the file delimiter node to read the data as I know the field delimiter.

    2. or maybe someone has already tried to use the python ftp get node to get an ascii file from mainframe with CR & LF.

    many thanks

  2. #2
    Lavastorm Employee
    Join Date
    Nov 2012
    Warrington, UK


    If the file is relatively small you may be able to use something similar to that outlined in the attached example.
    The data is initially read in using ASCII control characters ('BEL' and 'ENQ') in place of the usual field and record delimiters.
    The data is then chunked into the number of characters in a line (50 in the example) and output from the Filter node.
    The multi-record data is then written to a temp file and read in by the Delimited File node.
    The node will generate an error if the final line does not have the expected number of characters.

Posting Permissions

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