LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Need help to read file from mainframe

    Employee
    Posted 05-17-2018 21:04

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: newbie

    Hi

    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.  RE: Need help to read file from mainframe

    Employee
    Posted 05-18-2018 08:00

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: awilliams1024

    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.

    Read_Small_Delimited_Test_File_With_No_Line_Breaks.zip