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 (July 2001, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 12 Jul 2001 11:33:18 -0400
Reply-To:   "Braten, Michael (Exchange)" <mbraten@BEAR.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Braten, Michael (Exchange)" <mbraten@BEAR.COM>
Subject:   Re: Dynamic View
Comments:   To: Nigel Tufnel <dousk8@HOTMAIL.COM>
Content-Type:   text/plain

In that case some kind of MACRO will have to be developed. One scenario would have the use of a macrovariable whose value would be a list of variables for the KEEP statement. This macrovariable could then be checked for the existence of a variable name { maybe via %sysfunc(index .... } . If it is present, you can set another macrovariable to a 'y' or 'n' . then based on the flag , the code doing the calculations will/won't be executed.

( whew! its harder to describe thane to code! )

> -----Original Message----- > From: Nigel Tufnel [SMTP:dousk8@HOTMAIL.COM] > Sent: Thursday, July 12, 2001 11:13 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: Dynamic View > > Michael, > > Thanks for the response. I agree that the drop or keep option on the > output > data set will limit the number of columns written to the output data set. > What I'd like to avoid, however, is for the view to calculate all of the > 99 > variables that I will not use (which, I believe, slows down the whole > process). > > Thanks again, > Nigel > > >From: "Braten, Michael (Exchange)" <mbraten@bear.com> > >To: "'Nigel Tufnel'" <dousk8@HOTMAIL.COM>, SAS-L@LISTSERV.UGA.EDU > >Subject: RE: Dynamic View > >Date: Thu, 12 Jul 2001 10:13:11 -0400 > > > >I would think that a DROP or KEEP dataset option would be of use. > > > > > > data theview(KEEP=NEWVAR1 ) /view=theview; > > set base; > > newvar1 = oldvar1*10; > > > >ONLY the variables stated in the Keep will reside in the dataset or > view. > > > > > > > -----Original Message----- > > > From: Nigel Tufnel [SMTP:dousk8@HOTMAIL.COM] > > > Sent: Wednesday, July 11, 2001 8:46 PM > > > To: SAS-L@LISTSERV.UGA.EDU > > > Subject: Dynamic View > > > > > > We use a standard data step view for most of our analysis. The base > >data > > > set (from which the view is created) has about 100 columns and the > view > > > generates about 100 additional columns. Running proc's against the > view > > > can > > > take considerablly longer than running against the base sas data set. > > > Most > > > of the time, however, I'm forced to use the view because the column > that > >I > > > need is not in the base data set. Sample code for the view looks > like: > > > > > > data theview/view=theview; > > > set base; > > > newvar1 = oldvar1*10; > > > newvar2 = put(oldvar1,fmt1.); > > > newvar3 = ............ > > > etc...... > > > run; > > > > > > Anyway, I'd like the view to generate only the variables in which I am > > > interested in using. For example, if I need only newvar1, I'd like > the > > > view > > > to generate only newvar1 (and not newvar2, etc.) I can probably think > >of > > > a > > > kludgy way to do this that would likely clutter up the view code a > lot. > > > Is > > > there any cool way to generate only the variables I want? > > > > > > Thanks, > > > Nigel > > > _________________________________________________________________ > > > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > > > >*********************************************************************** > >Bear Stearns is not responsible for any recommendation, solicitation, > >offer or agreement or any information about any transaction, customer > >account or account activity contained in this communication. > >*********************************************************************** > > > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com

*********************************************************************** Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication. ***********************************************************************


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