I have to create my query so that my date is >= today and I have
market_row_eff_dt >= not sure what to put in???
you may be looking for: Date() which returns the current date. BUT your variable name ending in DT makes me think you are actually comparing a DATETIME value, not a date. if that is the case you may be looking for DATEPART(market_row_eff_dt) ge Date().
I cannot get this to work within my proc sql code. I put a bit below of what I have.
So in my proc sql code I have
proc_cd in (&ortho)
and
datepart(market_row_eff_dt) >= date()
???
I cannot use get in the SQL statement
makesure both datepart(market_row_eff_dt),
date() should be in same format. otherwise you get error.
You can use DATE() to get today's date and DATETIME() to get the current time as a datetime value.
You can also use &SYSDATE9 to get the date that the program session started. and &SYSTIME to get the time it started.
You can specify a date literal in SAS by using quoted string followed by the letter d. Use the date. format. For example today is
"06MAR2012"d
For datetime use dt as the suffix. "01MAR2012:14:18"dt
You can use %SYSFUNC to let you call DATE() and generate the string.
"%sysfunc(date(),date9.)"d
Are you referencing an external database? or just referencing SAS datasets? Different databases will have different ways of storing dates (datetime versus date only for example) and specifying a specific date (does it use ddMMMyyyy format like SAS or does it want YYYYMMDD or some other format.)
well this is my fix
market_row_eff_dt >= current date
no () no ' just current date typed as u see and a space between. how odd. guess that is how DB2 handles it
Not odd. That is how DB2 specifies it. Take a look at: http://www.ibm.com/developerworks/data/library/techarticle/0211yip/0211yip3.html
And you never bothered to let us know you were reading DB2 files. All of the above solutions work on SAS datasets.
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.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.