Hi,
I created a new column with only Today() function. However, it returns the date as of 01Jan1960, not today's date.
Any idea?
Please supply your complete program. One possibility is that the variable you are assigning TODAY() to is fomatted as a DATETIME not as a DATE. Without your code we would just be guessing.
Hi, below are the codes. This time I did not formatt it. The number SAS gives me for every available row is 20445. I also attached a image of the result it gave me.
PROC SQL;
CREATE TABLE WORK.QUERY_FOR_THE_SEASON_PARTIC_0002 AS
SELECT t1.GuestNumber1,
/* COUNT_of_GuestNumber1 */
(COUNT(t1.GuestNumber1)) AS COUNT_of_GuestNumber1,
/* Calculation */
(TODAY()) AS Today()
FROM WORK.QUERY_FOR_THE_SEASON_PARTIC_0000 t1
GROUP BY t1.GuestNumber1,
(CALCULATED Calculation);
QUIT;
PROC SQL;
CREATE TABLE WORK.QUERY_FOR_THE_SEASON_PARTIC_0002 AS
SELECT t1.GuestNumber1,
/* COUNT_of_GuestNumber1 */
(COUNT(t1.GuestNumber1)) AS COUNT_of_GuestNumber1,
/* Calculation */
TODAY() AS Today format = date9.
FROM WORK.QUERY_FOR_THE_SEASON_PARTIC_0000 t1
GROUP BY t1.GuestNumber1,
(CALCULATED Calculation);
QUIT;
Hi, I wrote your codes now but it still gives me the same result--see image below.
Below are the codes:
PROC SQL;
CREATE TABLE WORK.QUERY_FOR_FILTER_FOR_QUERY__0003 AS
SELECT t1.GuestNumber,
/* COUNT_of_GuestNumber */
(COUNT(t1.GuestNumber)) AS COUNT_of_GuestNumber,
/* Today */
TODAY() AS Today
FROM WORK.QUERY_FOR_FILTER_FOR_QUERY_FOR_T t1
GROUP BY t1.GuestNumber,
(CALCULATED Today);
QUIT;
Thank you
As Reeza has stated you left off FORMAT = date9.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.