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 (February 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Nick <nick_s_downie@HOTMAIL.COM>
Content-Type: text/plain; charset="iso-8859-1"


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;

-----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?


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;

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