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 (June 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 3 Jun 2002 08:17:09 -0400
Reply-To:   "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Organization:   MindSpring Enterprises
Subject:   Re: Dynamically assigning values to columns
Content-Type:   text/plain;

"Deepak Ramanathan" <deepakramanathan@yahoo.com> wrote in message news:3442e880.0206030357.465534f1@posting.google.com... > Hi all, > I have a column which displays the date a particular event will occur. > I need to create a column that will display the number of days left > for that event but I need this to be dynamically changed based on the > current date.. > i.e. > today(03/06/02) the table will look like > event_date days left > 10/06/02 7 > > tommorow(04/06/02) the same table will look like > event_date days left > 10/06/02 6 > > I tried assigning the column a value of > days_left = event_date - today() > > but that stores it in the table as a one off thingy... > > Any suggestions? > > Deepak

Deepak:

You need to create a view instead of a table.

data <libname>.DeepaksView / view=<libname>.DeepaksView ; set OriginalData; days _left = event_date - today(); run;

You can also use Proc SQL to create views

Proc SQL; create view <libname>.DeepaksView as select *, event_date - today() as days_left from OriginalData ; quit;

-- Richard A. DeVenezia http://www.devenezia.com/downloads/sas/macros/#sas2xls Use Perl to create an Excel file containing one worksheet per SAS dataset


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