|
Nigel,
How about change your data set view to
sql view?
data xx;
input a b c;
cards;
1 2 3
3 4 5
7 8 9
;
proc sql;
create view theview as
select a*10 as newa,
put(b,10.) as newb,
c**2 as newc
from xx
;
you'll only see the new vars
in yy.
I guess the mechanism behind a data set view
might be same as sql(?) view, so why do't we go straight
to sql view?
Just a thought.
Ya Huang
> -----Original Message-----
> From: Nigel Tufnel [mailto:dousk8@HOTMAIL.COM]
> Sent: Thursday, July 12, 2001 8: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
>
[text/html]
|