BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kody_devl
Quartz | Level 8

I have a series of queries that consecutively run using PROC SQL:

This query requires (one in the series) that I update the hardcode current day (today)('23Sep2016'd).

 

How can I insert a variable that automaitcally has today's date?

 

PROC SQL;

CREATE TABLE WORK.Roll_3 AS

t1.Loan_Number,

-(COUNT(t1.Loan_Number)) FORMAT=CHAR10. AS cnt

FROM WORK.LOAN_DETAIL_STATUS t1

INNER JOIN WORK.LOAN_DETAIL_SRCES t2 ON (t1.Out_Status_Day = t2.Source_Date_dte)

WHERE t1.Last_Stat = '*' and t1.Out_SYS_date <>'23Sep2016'd

GROUP BY

t1.Loan_Number,

QUIT;

 

Many thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kody_devl
Quartz | Level 8

 

This works perfectly!  Thankyou

 

WHERE t1.Last_Stat = '*' and t1.Out_SYS_date <> today()

 

View solution in original post

3 REPLIES 3
LinusH
Tourmaline | Level 20
Just add it to you select clause.
You may also consider using the automatic macro variable sysdate since it could be less resource consuming, especially in the where clause.
Data never sleeps
Reeza
Super User

It's either today() or date() can't remember at the moment. 

Kody_devl
Quartz | Level 8

 

This works perfectly!  Thankyou

 

WHERE t1.Last_Stat = '*' and t1.Out_SYS_date <> today()

 

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1700 views
  • 0 likes
  • 3 in conversation