- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 03-03-2010 08:04 AM
(3416 views)
Hi
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" ;
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" ;
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Scott Barry
SBBWorks, Inc.
http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000178980.htm
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.
Scott Barry
SBBWorks, Inc.
http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000178980.htm
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Scott
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.
data _null_;
file dlc;
run;
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
Any suggestion?
Thanks in advance.
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.
data _null_;
file dlc;
run;
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
Any suggestion?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Please share your entire SAS program, pasted from your SAS log!
Scott Barry
SBBWorks, Inc.
Scott Barry
SBBWorks, Inc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
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.
From: http://support.sas.com/kb/1/632.html
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.
Also, this note:
http://support.sas.com/kb/4/470.html
explains that:
When you use the FTP device type with Universal Printing, you may
receive the following error message:
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.
cynthia
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.
From: http://support.sas.com/kb/1/632.html
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.
Also, this note:
http://support.sas.com/kb/4/470.html
explains that:
When you use the FTP device type with Universal Printing, you may
receive the following error message:
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.
cynthia