03-01-2017 08:40 AM
filename ftpdir ftp ' ' list firstname.lastname@example.org' pass='topsecret' host='our.proxy.server' port=8080 cd='download/' PASSIVE debug; data ftp_dir (drop=str: hh) ; infile ftpdir dsd dlmstr=' ' MISSOVER; informat strDate $8. strtime $7. bytes 8. name $50. ; input strDate strtime bytes name ; format Datetime datetime20. hh 2. date ddmmyy8.; date=MDY(substr(strDate,1,2)*1,substr(strDate,4,2)*1,substr(strDate,7,2)*1); if substr(strtime,6,2)='PM' then hh=substr(strtime,1,2)+12; else hh=substr(strtime,1,2)*1; Datetime=DHMS( date , hh , substr(strtime,4,2),0); run;
SAS takes this filename statement, but then the datastep end with a critical error:
ERROR: An exception has been encountered. Please contact technical support and provide them with the following traceback information: The SAS task name is [DATASTEP] ERROR: Read Access Violation DATASTEP Exception occurred at (09264F14) Task Traceback Address Frame (DBGHELP API Version 4.0 rev 5) 0000000009264F14 000000000B82F120 sasdsx:tkvercn1+0x23ED4
I tried to take the passive parameter out, but same error. It just doesn't want to read the ftp directory. I am absolutley clueless.
03-01-2017 08:54 AM
filename ftp is for direct connections to the ftp server port, it does not supply the necessary information that tells the "everything"-proxy which protocol is being used. By default the proxy expects http.
You may have to have the ftp port opened on the firewall for outgoing connections. Then you will also need the passive option.
03-02-2017 03:26 AM
After further research, I think your method should work, but it can only work if your proxy is also a FTP proxy.
To test this, start Windows ftp (without parameters).
Enter the following:
open our.proxy.server 8080
email@example.com (when prompted for username)
topsecret (when prompted for password)
if you don't get a connection, your proxy probably doesn't support FTP connections
If that works, open a track with SAS Technical Support, as you may have a SAS-internal problem
03-07-2017 03:26 AM
nothing works. I think it is the proxy server that doesn't know ftp. However using powershell I can use the Webclient Object & Method "downloadFile".