BookmarkSubscribeRSS Feed
helannivas88
Obsidian | Level 7

Hi ,

 

I have a sas code using pass through and runs the SQL statement in DB2 directly. But the query is inefficient because of multiple joins and throws an DB2 warning. Even from the SAS client , I'm getting the same warning message , but the end results are fine.

 

I want to suppress the warning message in SAS that comes out pass through. Is there any way to suppress and I tried multiple method, but ended up in failure.

 

Please let me know the solution if available. Thanks in advance. 

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

Did you try the NOWARN option for proc sql?

Did you try improving the query?

Patrick
Opal | Level 21

In my opinion SAS does the right thing to capture and surface the Warning DB2 throws.

As this is DB2 explict pass-through code I'd suggest you investigate how to capture the Warning on the DB2 side. In Oracle you'd be using PL/SQL for this. Don't know how that's done with DB2.

Kurt_Bremser
Super User

As soon as you use explicit passthrough, you switch to a foreign language, and need to use that language's tools. Rephrase your DB/2 code in such a way that it does not throw a WARNING. Or use a proper DB/2 option for this.

Bottom line: study the DB/2 documentation. Maxim 1 is valid in all environments.

helannivas88
Obsidian | Level 7

Thanks All...I tried with the suggestion , but not able to suppress warning.. So tuned the DB2 query to not to throw any warning.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1400 views
  • 0 likes
  • 4 in conversation