Are there syntax differences using filename sftp between sas 9.3 and 9.4?

Viewed 174

I hope someone can help - I've read the documentation on using filename sftp within sas and it suggests that this is supported by v9.3. I’m using this syntax:

Filename myfile sftp ‘path’ user=&user host=&host;

This is absolutely fine in 9.4. However, I get ‘invalid option name’ errors for user and host in 9.3.

Is there different syntax I should be using or is there some other issue here?

I have already established connection outside of sas.

Many thanks!

2 Answers

You normally do not use specify user and password with SSH authentication. Use the OPTIONS= keyword to specify the SSH options for authentication.

The SAS 9.3 syntax reference for "FILENAME Statement, SFTP Access Method" shows the values for the options user= and host= as quoted. The documentation also contains several examples.

The macro variable values (you do not show them) most likely do not already quotes.

Try using double quotes so the macro variables are resolved within:

Filename myfile sftp 'my-external-file' user="&user" host="&host";

Also, if your code contains fancy quotes (those curvy ones ‘ and ’) you will also have problems.

Related