LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2000, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 14 Aug 2000 12:17:00 GMT
Reply-To:     sashole@mediaone.net
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Paul Dorfman <paul_dorfman@HOTMAIL.COM>
Subject:      Re: Can you clear Macrovariables from the PDV during program run?
Comments: To: erpadmin@MY-DEJA.COM
Content-Type: text/plain; format=flowed

Tom,

Strictly speaking, clearing macro variables from PDV is impossible, because they do not reside there. Unfortunately, it is not possible to clear *variables* from PDV, either, for instance, redimension an array - memory allocation management in the DATA step is not provided. (Of course, a clever one could clear everything in the DATA step at once by means of STOP or ABORT, or everything including the macro memory using ENDSAS, but I am sure this is not what we are talking about here :-).)

I do not know of any reliable method available to manage macro memory allocation, either. However, I have not found any significant correlation between the performance of the DATA step and Base procedures with the macro memory 'polluted' with thousands of macro variables, and without such pollution. Macro memory appears to be manages separately, which also makes a lot of common sense. Of course, at the extreme, one might conceieve a situation where an adverse interaction between the macro memory and the rest of the stuff would occur at the hardware level, for instance, if macro memory utilization is so large that it affects total memory consumption with swapping to the virtual memory and performance degradation as a result.

On the other hand, if by 'clearing macrovariables' you mean assigning null values, then it is of course possible. For instance, you can acquire the information about all available user macro variables from the dictionary tables and then use CALL SYMPUT to fill them out with nulls. I can imagine one situation where such action would reduce total memory usage, namely, if existing macrovariables hold long string values. Say, consider the following:

22 %macro a; 23 %do i=1 %to 5000; 24 %global a&i; 25 %let a&i = %sysfunc(repeat(1,199)); 26 %end; 27 %mend; 28 %a 29 data _null_; run; NOTE: The DATA statement used 0.01 CPU seconds and 10531K.

30 data _null_; 31 do i=1 to 5000; 32 call symput ('a'||left(put(i,4.)),''); 33 end; 34 run; NOTE: The DATA statement used 0.17 CPU seconds and 9860K.

35 data _null_; run; NOTE: The DATA statement used 0.01 CPU seconds and 9735K.

The amount of the memory thus saved roughly corresponds to 5000*200 bytes (minus whatever space the null variables may occupy), so the above assumption may be plausible.

Kind regards, ========================= Paul M. Dorfman Jacksonville, Fl =========================

>From: erpadmin@MY-DEJA.COM >Reply-To: erpadmin@MY-DEJA.COM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Can you clear Macrovariables from the PDV during program run? >Date: Mon, 14 Aug 2000 07:18:46 GMT > >Hi, > >I was wondering whether is possible to clear macrovariables (i.e. >remove them) from the PDV/memory? > >I have a program generating hundreds of macrovariables with >corresponding values. It would be more efficient, I think, if I could >tell the program to drop/remove the macrovariables that are no longer >needed for the remainder of the program. > >Is this possible and how? > >Kind regards, > >Tom Ceyssens >ALZ Stainless Steel > > >Sent via Deja.com http://www.deja.com/ >Before you buy.

________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


Back to: Top of message | Previous page | Main SAS-L page