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

 

Dear Team, 

 

a

am getting below error : 

 

ERROR: CLI describe error: [IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected token "case" was found following "else
rstf.END_TS end". Expected tokens may include: "FROM". SQLSTATE=42601

1 ACCEPTED SOLUTION

Accepted Solutions
r_behata
Barite | Level 11

Looks like Your Case statement Nesting is incorrect . try expanding all the scenarios like this :

 

case 
	when dt.DATE_TIME_KEY+900 < rstf.END_TS then 
                            dt.DATE_TIME_KEY+900
	when dt.DATE_TIME_KEY+900 > rstf.END_TS then rstf.END_TS 
	when dt.DATE_TIME_KEY > START_TS then dt.DATE_TIME_KEY
	when dt.DATE_TIME_KEY < START_TS then rstf.START_TS
end 

View solution in original post

3 REPLIES 3
r_behata
Barite | Level 11

Looks like Your Case statement Nesting is incorrect . try expanding all the scenarios like this :

 

case 
	when dt.DATE_TIME_KEY+900 < rstf.END_TS then 
                            dt.DATE_TIME_KEY+900
	when dt.DATE_TIME_KEY+900 > rstf.END_TS then rstf.END_TS 
	when dt.DATE_TIME_KEY > START_TS then dt.DATE_TIME_KEY
	when dt.DATE_TIME_KEY < START_TS then rstf.START_TS
end 
Tom
Super User Tom
Super User

In addition to your messed up CASE statement (statements?)  are you really trying to SUM() dates?  

What is in the variables DATE_TIME_KEY, END_TS and START_TS ?

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

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.

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
  • 3629 views
  • 0 likes
  • 3 in conversation