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