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 2011, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 24 Aug 2011 16:29:43 -0500
Reply-To:   Joe Matise <snoopy369@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Joe Matise <snoopy369@GMAIL.COM>
Subject:   Re: translate a macro code for me??
Comments:   To: "Durrett, Cindy" <CindyDurrett@fdle.state.fl.us>
In-Reply-To:   <B39864771C6F074BB21AA235089174DD0174B299AE@MBX1.myfdle.net>
Content-Type:   text/plain; charset=ISO-8859-1

I would think some others can give more information, but in general what that's doing is looking up the number of observations in a table, and defining a new macro variable (buffer) that is defined as (# obs + 1000) * (length of observation). Length of observation = number of bytes required to store a single record. So basically that buffer size would be slightly higher than the total amount of space needed to store that entire dataset (1000 records higher, specifically), if I read that properly. I assume that &buffer is used later to set the read (or write?) buffer size so to allow you to read or write the dataset more efficiently (based on the size of the dataset).

That seems like it would generate some pretty big buffer sizes for large tables (is it useful to have a buffer that is several GB in size?), but who knows...

-Joe

On Wed, Aug 24, 2011 at 4:19 PM, Durrett, Cindy < CindyDurrett@fdle.state.fl.us> wrote:

> Hi all. I inherited some code for a program that I understand how the > program works but I'm not sure what this part does - I think it has to do > with making sure there's enough of a buffer for doing the matching / sorting > / sql'ing that the rest of the program does (this is at the beginning of the > program with a note that says 'DO NOT ALTER THIS CODE' - anyway, I was > wondering if someone could "plain English" this for me - I'd like to > understand more about what controls programmers can have with SAS for > managing space, etc. > > Thanks, > > *************************************************************** > > %global buffer ; > > %macro getparms(libfil); > %let lib=%scan(&libfil,1,.); > %let mem=%scan(&libfil,2,.); > > proc sql; > select nobs, obslen into:nobs, :obslen > from sashelp.vtable > where libname=upcase("&lib") and memname=upcase("&mem"); > quit; > %put; > %put Value of Lib= &lib; > %put Value of Mem= &mem; > %put; > %let newnobs=%eval(&nobs+1000); > %let buffer=%eval(&newnobs*&obslen); > %PUT Value of buffer= &buffer; > %mend getparms; > > **************************************************************** > > Cindy Durrett > Florida Statistical Analysis Center > Crime Information Bureau, FDLE > 850-410-7141 > visit our website: http://www.fdle.state.fl.us/FSAC/ > Florida has a broad public records law, and all work-related emails sent by > or to me may be subject to public disclosure >


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