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

I am trying to bring over a date only if it fits the between parameters - it says valid but it is not working

 

ifn(t1.ADDNM122016 is missing AND t1.IM_REM_DT>= 01/01/2016 AND t1.IM_REM_DT<=1/12/2019, t1.IM_REM_DT, t1.ADDNM122016)

1 ACCEPTED SOLUTION
5 REPLIES 5
maliksmom2000
Obsidian | Level 7

I'm sorry, 9 hours straight I think it getting to me Smiley Happy  Thank you so much it worked!

maliksmom2000
Obsidian | Level 7

It worked on a different formula but not this one.  What am I missing?  I AM SO SORRY!!!!

 

4 PROC SQL NOEXEC;
5 SELECT (ifn(t1.ADDNM122016 is missing AND t1.IM_REM_DT >= “01JAN2016”d AND t1.IM_REM_DT <= ”01JAN2019”d,
_ _
22 22
200 200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, (, +, -, ALL, ANY, BTRIM, CALCULATED, CASE, INPUT, PUT, SELECT, SOME, SUBSTRING, TRANSLATE, USER.

Kurt_Bremser
Super User

Your code has "slanted" quotes, these UTF symbols are illegal in code. Use ONLY the internal SAS editors, or pure text editors suited for programming. Word Processors like MS Word are poison for code, as they tend to automatically do "intelligent" formatting.

 

 

maliksmom2000
Obsidian | Level 7

Oh WOW thank you so much.  I had copied the code to WORD so I could copy it and use it again.  I will always retype them.  Thank you so much.  Has anyone ever told you how brilliant and helpful you are?  If not I AM!!!!! 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1540 views
  • 2 likes
  • 2 in conversation