Filename with variable date appended

Advertisement

suncawy
Guest

Filename with variable date appended

Hi,

I have winscp 4.1.6 version and DO NOT have the console interface tool (winscp.com). On a monthly basis, I will need to download a file with the date appended to the end of the file. For example, "Myfile_Aug2009.sas7bdat" then the following month
"Myfile_Sep2009.sas7bdat", etc. How do I write a script where the month/year date will change ? The Javascript example on this site won't work since I don't have the console interface tool. Any help is much appreciated.

Here is what I have so far with the script, works great except that I would have to change the date each month:
option batch on
option confirm off
option transfer binary
open sftp://<userid>:<passwrd>@<session
get /apps/sas/datasets/data47/COSMC/GI/OutputData/Myfile_Aug2009.sas7bdat c:\temp
exit

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Filename with variable date appended

Please read documentation. If that does not help, come back.
_________________
Martin Prikryl

Reply with quote

suncawy
Guest

Re: Filename with variable date appended

martin wrote:

Please read documentation. If that does not help, come back.

Okay, I went to the link and could not figure out the example and how it would apply. In particular, I couldn't get the session to connect properly and I don't have winscp.com. So, this area in the code is confusing:

// Session to connect to
var SESSION = "test@127.0.0.1";
// Path to winscp.com
var WINSCP = "c:\\program files\\winscp\\winscp.com";

Is there anything else ?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Filename with variable date appended

suncawy wrote:

winscp.com
So go and download it.

So, this area in the code is confusing:
What's is confusing about that? What do you miss/expect?
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum