FTP Files from Linux might contain "bad data" due to missing carriage returns


When transferring files from a Linux server via FTP, the incoming data might appear incorrect or incomplete in SAS. This issue occurs because Linux text files typically use Line Feed (LF) only, but many SAS processes expect Carriage Return + Line Feed (CRLF).

To ensure that SAS reads the file correctly, you must specify termstr=lf in the FTP FILENAME statement, which tells SAS to treat LF as the line terminator.

Here is an example:

filename xxxxxx ftp "xxxx.xxxx.xxxx"
    host="xxxx.xxxx.xxxxx"
    user="xxxxxx"
    pass="xxxxxxx"
    termstr=lf;

Using termstr=lf ensures that all lines are read properly from Linux‑originated files.