Date: Thu, 10 May 2007 17:35:19 -0400
Reply-To: Don Henderson <donaldjhenderson@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Don Henderson <donaldjhenderson@HOTMAIL.COM>
Subject: Re: 'Local' datasets in Macro?
In-Reply-To: <7367b4e20705101345v2ccc5fb3v78ed20a5b6e13968@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
You are making far too many assumptions.
Frankly, adopting a standard of creating a temp directory under WORK is,
IMO, a pretty bad idea. While there may be occasions where it is an
appropriate solution (my motto is to rarely say never or always), it is not
something I would want to encourage as a good idea or best practice.
There are too many possible gotchas here. And that is not even factoring in
the issue of support for multiple environments.
For example, what if the macro abends (e.g., runs out of space) and does not
delete the subdirectory? That leaves remnant work libraries. The IT folks
love to use that as a reason to bash SAS - that is eats space and does not
clean up after itself.
And so on, and so on. . . . . .
To each his own, I guess.
Regards,
donh
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of data
> _null_;
> Sent: Thursday, May 10, 2007 4:46 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: 'Local' datasets in Macro?
>
> On 5/10/07, Ian Whitlock <iw1junk@comcast.net> wrote:
> ...snip...
> > Here is the log for creating a subdirectory of the work directory and
> then
> > putting a simple data set in it. Unfortunately the work will *NOT* be
> > wiped out when the SAS session is closed, probably due to containing a
> > subdirectory.
>
> This can be handled in Windows with RM. If we create it we can surely
> delete it.
>
> Thanks for pointing out that the directory needed to be deleted so SAS
> will clean-up WORK properly.
>
> Example using SYSTASK where LOCALPATH contains the unique name
> generated when the macro is called.
>
> systask COMMAND %sysfunc(quote(RM -R "&localPath")) wait;
>
>
> systask COMMAND "RM -R ""F:\Temp\SAS Temporary
> Files\_TD11780\eb368e77-ae01-418a-8c54-0fb2acca9242""" wait;
>
> I never say never but I expect that creating a LIBRARY as a sub
> directory of WORK is "safe enough" for any scenario that I could dream
> up.
|