BookmarkSubscribeRSS Feed
niemannk
Calcite | Level 5
filename ftpdir ftp  ' ' list 
				user='username@ftp.server.com'
				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.

4 REPLIES 4
Kurt_Bremser
Super User

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.

niemannk
Calcite | Level 5

not sure if I understand it correctly, but I would conclude that it simply will not work...

Kurt_Bremser
Super User

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

username@ftp.server.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

niemannk
Calcite | Level 5

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".

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3478 views
  • 0 likes
  • 2 in conversation