Date: Thu, 28 Feb 2002 15:53:59 -0500
Reply-To: Ian Whitlock <WHITLOI1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ian Whitlock <WHITLOI1@WESTAT.COM>
Subject: Re: referencing sas views in sql vs data step
Content-Type: text/plain; charset="iso-8859-1"
Nick,
Don't make problems for your self. If you don't want, don't get it. For
your example use
proc sql;
create view vindex as
select *
,99 as number
from index ( drop = number ) ;
quit;
IanWhitlock@westat.com
-----Original Message-----
From: Nick [mailto:nick_s_downie@HOTMAIL.COM]
Sent: Thursday, February 28, 2002 12:39 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: referencing sas views in sql vs data step
Hi, hope u can help - I basically want to create a view of a large
dataset but also to overwrite one of its variables. I know a view
holds as many columns as you define, and that these can be called the
same name, and I know that when this is read into sql it is dealt with
differently than datastep, but how can i create a view that will
ensure a consistent approach, ie value always overwritten regardless
of where the view is used?
thanks
In this case d/set one is altered by two is not. Also NB i need to use
select * as the source dataset contains > 100 variables, and this may
be liable to change.
Test code below..
data index;
input var1 $ number;
cards;
A 2
B 3
C 4
D 9
;
run;
proc sql;
create view vindex as
select *
,99 as number
from index;
quit;
data one;
set vindex;
run;
proc sql;
create table two as select * from vindex;
quit;