BookmarkSubscribeRSS Feed
ding_dong
Calcite | Level 5
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" ;
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
ding_dong
Calcite | Level 5
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Please share your entire SAS program, pasted from your SAS log!

Scott Barry
SBBWorks, Inc.
Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 2725 views
  • 0 likes
  • 3 in conversation