|
I have a process in SAS that creates a .csv. I have another process in Python that waits until the file exists and then does something with that file. I want to make sure that the Python process doesn't start doing its thing until SAS is done writing the file. I thought I would just have SAS create the .csv and then rename the file after it was done. Can I do the renaming in SAS? Then the python process could just wait until the renamed file existed. |
|
You could make use of the Something like:
Note that
this is working for me. i have some space in my directory names, so that took me awhile to figure out, but now i'm up and running. (I used the %str function)
(15 Nov '10, 02:02)
rstlne
|
|
Edit: This suggestion is for version 9.2 and later (thanks @sasfrog for the heads up!). SAS has a built in rename function that you can use. This bypasses the issues that you might run into with restrictions on the 'x' command and is portable to different hosts. e.g.
1
+1 I didn't know about this function - note that it is new for 9.2. I assumed the OP is using SAS 9.1.3, given he's on XP, but I could be wrong.
(15 Nov '10, 23:21)
sasfrog
@sasfrog You are correct - this is 9.2 and later - I added an edit to clarify this point.
(16 Nov '10, 15:25)
cmjohns
thanks to both of you. we actually have 9.2 on some of our xp machines and 9.1.x on some others, so i probably will not use rename for now. looks like a better solution though for down the road.
(18 Nov '10, 05:16)
rstlne
|