Prev: Error SAS to ORACLE
Next: Questions about SAS DDE,
From: David L Cassell on 4 Dec 2006 01:27 vanwamelen(a)GMAIL.COM wrote: > >Is there a way to make a copy of an external files from SAS (without >using SYSTEM or X)? > >I want to "proc import" an excel file even if the user already has it >open. The idea is to first copy it to C:\temp (OK not very portable...) >and then "proc import" the copy. I can do it with "system" and the >noxwait option, but that pops up that ugly window, very distracting. I >see I can do things like > rc=rename('d:\temp','d:\testfile','file'); >but is there an equivalent for "copy"? I can't find it anywhere! > >Any help would be greatly appreciated! > >Paul It is simply not possible to access all files regardless of the current availability of the file. The whole point of a lot of OS software is to prevent such a thing. If anyone can access a file while others are accessing it, there is the chance of file corruption, generation mix-ups, etc. It is generally considered A Bad Thing. So I would re-think the problem first. If someone else has the file open, you should stop the process. Perhaps you should send them a note (an email or a pop-up window or ...) asking them to close the file for your process. But don't copy files while other people are working on them. And finally, SAS is not designed as a systems administration tool. The SAS Metadata Server and some other components are designed for such issues, but the SAS data step is not for this. I would recommend a more robust method, using a more robust language that can do a much better job of the error-handling that you need in a process like this. I would go with Perl, but that's just my personal preference. Others might recommend C# or Python or VB or ... HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330 _________________________________________________________________ Share your latest news with your friends with the Windows Live Spaces friends module. http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mk |