I'm trying to create a directory via the FTP filename statement with no success. The code I'm using is provided below. The TEMP directory already exists. I need to create a subdirectory called test. Any suggestions?
Thanks in advance.
filename dlc ftp "/TEMP/test/" dir new host="&host" user="&userid" pass="&ftppwd" ;
Your syntax is correct, per the SAS 9.2 DOC, FILENAME stmt (with FTP access method). Have you attempted to execute the code and you get some type of error? Share your actual SAS log please and help clarify your SAS execution behavior as to what error, if any, is generated by SAS?
Oh yes, let us know that you are able to create the same directory outside of SAS, by the way -- a key consideration to contribute.
Thanks for the reply. The problem I'm having is when I access the filename within the datastep.
I'm using the filename statement statement as specified and using the below datastep.
I'm able to create the directory using the above. However, I receive the below error message.
ERROR: Invalid Reply received for the STOR command..
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.05 seconds
cpu time 0.01 seconds
With regard to that very same error message, this Tech Support note explains that: You can use the FTP access method on a FILENAME statement with SAS/GRAPH
device drivers as long as the FILENAME statement references a specific
file (as opposed to a directory location). If you attempt to use the
FTP access method on a FILENAME statement that refers to a directory
location, the following error messages will appear in the SAS Log:
Invalid reply received for the STOR command.
Unable to open graphics device.
Unable to initialize graphics device.
Even though your program is not using SAS/GRAPH, you -are- attempting to write to a directory and not to a specific file. You might wish to open a track with Tech Support to determine whether this note is relevant to your issue with FTP filename engine.
Error: Invalid Reply received for the STOR command...
The reason is that FTP needs write access to a pre-existing file on
the FTP server.
Again, even though this second note was specific to Universal Printing, I sense a "theme" in the use of the FTP filename engine: it might be "happier" if you pointed to a named file. To me, this makes sense. Normally, when I take SAS out of the picture and just use FTP utilities, I am working at the FILE level to FTP back and forth. So I would expect that you can't just FTP a whole directory from within a SAS program -- you'd either have to FTP one file at a time into the directory or use some other kind of process to FTP the contents of an entire directory.
Since these 2 notes do not mention DATA _NULL_ specifically, you might wish to work with Tech Support on this issue. Or, post your entire LOG, as Scott suggests to give folks the most information to attempt to help you.