04-18-2012 01:15 PM
I'm trying to compare the dates in two fields, and delete the row based on a condition. Here's what I have:
if recalldate1>date365 then delete;
recalldate 1 is in the format:
date365 is in the SAS date format:
How do I convert one or the other to make this comparison?
Thank you in advance
04-18-2012 01:29 PM
or if ' recalldate1' is character variable, then:
datepart(input( recalldate1 ,datetime20.)) >date365 then delete;
04-18-2012 01:41 PM
Thanks Hai.kuo. Would you know how to do this within a PROC SQL:
CREATE TABLE PX_RECALL_1 AS
SELECT * FROM
(SELECT SUM(UNITS) AS RECALL1_UNITS
It doesn't recognize sysdate.
ERROR: The following columns were not found in the contributing tables: SYSDATE.
04-18-2012 01:51 PM
if sysdate is a SAS table variable, then you don't have it.
If what you are trying to do is to extract the SAS session starting date, then use &sysdate,
if what you need is the today's date, then use today() or date()
04-18-2012 02:00 PM
sysdate will be a date variable as will today() and date(), you'll still need to convert recalldate1 to a date format using datepart
Need further help from the community? Please ask a new question.