Hello, I have not worked much with FTP, but I know a little bit.
I am able to successfully use what is below to put a file in the appropriate folder.
however, I would like to put a new file in a new folder every week (by week ening)
so that in the folder /WEEKLY/Sunday/
there would be names of folders something like
jan-16-2021
jan-23-2021
jan-30-2021
etc. or does not have to be like that, the month could be a digit (1 in this case for Jan).
so, my question is how do I create a new folder here for every week? thank John
$ FTP QUALITY.AKST.COM /USER='PWD_ID'/PASSWORD='PWD_PWD'
QUOTE CWD /WEEKLY/Sunday/
put QUAL_LIS:BUY_H.LIS BUY_H.LIS
EXIT
Where does SAS come into this?
If you can run a command file that does the FTP upload/ download you could use the information from SAS to write the file.
If the X command is not disabled in your set up you could run the command file from SAS.
You might need to be more specific in your ftp commands than in an interactive FTP program such as if you have to make / change directories and setting the default file type(binary or ASCII )
I am not sure what you mean. sorry, I can write SAS code, but when it comes to code with command procedures, I am kind of a novice.
I guess I was thinking something like a loop depending on the day, so that if it is run on say, Thursday, jan 21st, it would go back five days, and created a folder titled 1-16-19, so it would do something like weekday (date) minus some number, always resulting in the preceding saturday to put in the created saturday folder. but I have never used a macro or loop to create many folders. does it make sense what I am asking?
I suggest working with one your admins or sysops that know your version of the FTP program.
Provide and explicit example to them of everything you need to do for one case including the names of any files that you want to move as an example. I suggest at least 2 files.
You need to know which options your process will actually need and then use them.
You may be able to use the FILENAME filerf FTP to assign the connection strings and options and write the data. There are way too many options to copy the entire documentation so search your SAS documentation for "Filename Statement, FTP"
Or hopefully:
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.