|
I'm sure that searching the SAS/L archives for temp and macro in the
last four weeks will turn up an extensive discussion on exactly this
matter.
Kind regards
David
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet,
consectetur, adipisci velit..."
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Paul Walker
Sent: Wednesday, 23 May 2007 7:22 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Work Library Files for a Macro System
Hello SAS-L,
I am developing / have developed a set of macros, aka "macro system".
Most of the macros use the WORK library as the primary location to
create temp datasets which are then deleted at the conclusion of the
macro. But one thing that tends to cause a problem with macros is how
you name the temporary datasets written to the work library. You might
over-write other files that already exist in the work library. Or, if
you need to recursively call a macro, at each recursion you may be
over-writing the dataset from the last recursion.
I have some ideas about how to solve this problem:
[1] Name all the temp datasets with a prefix according to the name of
the macro [2] Add a timestamp (date+time) integer to the dataset name
[3] Put error checking logic into the macro so that it only runs if the
datasets which it will create do not already exist [4] Need more
ideas...
Essentially, all files written to the work library are "Global" in scope
for a SAS session and I need to prevent conflicts between them. I would
like to create "Local" scope datasets for each time a macro is invoked.
Any suggestions??? For anyone who has developed macro systems, how have
you handled temp dataset naming conventions to increase the reliability
of the system?
- Paul
************** IMPORTANT MESSAGE *****************************
This e-mail message is intended only for the addressee(s) and contains information which may be
confidential.
If you are not the intended recipient please advise the sender by return email, do not use or
disclose the contents, and delete the message and any attachments from your system. Unless
specifically indicated, this email does not constitute formal advice or commitment by the sender
or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries.
We can be contacted through our web site: commbank.com.au.
If you no longer wish to receive commercial electronic messages from us, please reply to this
e-mail by typing Unsubscribe in the subject line.
**************************************************************
|