Hi All,
I am running below Teradata code using passthrough but facing some error:
SELECT *
FROM ABC LEFT JOIN BCD on A.ABC = B.BCD
WHERE MONTH > concat( cast(extract(year from add_months((DATE - extract(day from DATE)) ,-9)) as varchar(4)), SUBSTR(cast(100 + extract( month from add_months((DATE - extract(day from DATE)) ,-9)) as varchar (3)) ,2 ,2) )
I am not sure if we can use add_months in SAS, if not how can we resolve this?
Always (always!) when you run into problem with code, show the log!
And given that this is pass-thru, usually it's not a SAS issue.
But are you tring to use something from the local SAS session?, not clear from your post.
So which is it? You say you are using passthrough, if so this piece of code you present here will be sent to the database, and the database will execute it. Therefore it will use the functions available to the database.
You then proceed to say that you can't use add_months in SAS, which is true as add_months is not a SAS function, but as the code is not being run in SAS per your first statement, this is not relevant?
Please clarify what you mean, where is the code running, what logs you get etc.
Yes, this is the teradata script i am running and expecting all the teradata function like add_month, cast can run through pass through.
Error :
ERROR: Teradata execute: Syntax error: expected something between '(' and cast.
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!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.