This SAS KB article helps you troubleshoot errors that you receive when the FILENAME FTP Access Method fails to read or write data to an FTP server. First, add the DEBUG parameter to the FILENAME FTP statement as shown below in order to get detailed information and then execute the code again.
FILENAME <fileref> FTP " '<remote-file>' " HOST=host-name USER=user-name PASS=password DEBUG;
The output from the DEBUG parameter shows the FTP conversation between SAS (FTP client) and the remote FTP server:
Any notes beginning with NOTE: >>> are from SAS.
Any notes beginning with NOTE: <<< are from the remote FTP server.
Note: You can find additional information about these messages by searching the internet.
Here are some of the errors that you might receive with a description of why you receive them.
| Error Message | Reason You Receive It |
| ERROR: Invalid Reply received for the RETR command... |
|
| ERROR: Invalid Reply received for the STOR command... |
|
| ERROR: Invalid Reply received for the CWD command... |
|
| ERROR: Invalid Reply received for the PORT command... |
|
| ERROR: Invalid reply received from FTP server... |
|
| ERROR 23-2: Invalid option name XXXXX |
|
| ERROR: Logon attempt by <userid> rejected by FTP server... |
|
| ERROR: 10061 - WSAECONNREFUSED. |
|
Here are some possible DEBUG output notes that indicate a problem and their meaning:
| DEBUG Output Note | Reason You Receive It |
| NOTE: <<< 425 Unable to build data connection: Connection timed out NOTE: <<< 425 Can't open data connection. NOTE: <<< 425 Failed to establish connection. NOTE: <<< 425 No data connection |
|
| NOTE: <<< 501 Invalid data set name " 'SASTST.SMF.CPU.DAILY(7)' ". Use MVS Dsname conventions. |
|
| NOTE: 220 Login Required. Unauthorized Access Prohibited. |
|