DATA Step, Macro, Functions and more

Suppress Specific Error

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Suppress Specific Error

Hello, 

 

I'm running someone else's code, which includes a macro that passes through sql to a sql server. They're setting up the query using %str and double single quoting all text and dates, then the macro %bquote's it all and creates valid sql code. However SAS prefers us to put spaces before an after quotes. Which would invalidate the sql code. So my log is littered with the following errors/warnings. Everyone else seems fine with this as it still works. 

 

 

I can re-write to not use %bquote and use proc sql; with connection to sql_server. However I do not want to re-write someone elses code that uses this method for dozens of sql queries. 

 

Is there a way to suppress this message? It will clean up my log and also when the code is in EG, the process flow will not have red x's next to every sas script.

 

Thanks

Rhys

 

62 ''08/04/2017''
__
49
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended.


Accepted Solutions
Solution
‎01-12-2017 04:35 AM
Super User
Posts: 5,435

Re: Suppress Specific Error

That note actually says that your code isn't future proof. So you really consider fixing the program.

It sounds like you have this in many places, so perhaps you could make this more component based and just have this logic in one place (a separate macro).

The only way to fix this is with NONOTES, but then you might loose some valuable information in the log.

Data never sleeps

View solution in original post


All Replies
Super User
Posts: 11,343

Re: Suppress Specific Error

First, that is not an error only a NOTE: Errors would halt a datastep or procedure.

There may be work arounds but you haven't shown any code that would actually CAUSE that note. Your example does not show any identifier after the quoted string.

 

It may help to post the data step or procedure from the Log with the message(s) and paste into a code box openend using the {i} icon on menu bar in the forum. The code box will preserve the format of the code and error message. That _ is import in showing where SAS thinks the issue occurs but the forum boxes remove formatting unless using a code box.

 

It may help to run the code with Options MPRINT if you have macros as sometimes the actual issue is hidden by the macro processor.

Occasional Contributor
Posts: 9

Re: Suppress Specific Error

Thanks for the reply,

 

I say error as it shows up as red in the log. I understand the actual issue, it's do with passing macro variables within a %str to a macro which uses %bquote. The date is the identifier, which is surrounded by double single quotes, not a double quote.

 

I do not want to change any of the code, except for maybe adding an options statement like

 

options NONOTES=49;

 

 

 

Solution
‎01-12-2017 04:35 AM
Super User
Posts: 5,435

Re: Suppress Specific Error

That note actually says that your code isn't future proof. So you really consider fixing the program.

It sounds like you have this in many places, so perhaps you could make this more component based and just have this logic in one place (a separate macro).

The only way to fix this is with NONOTES, but then you might loose some valuable information in the log.

Data never sleeps
Occasional Contributor
Posts: 9

Re: Suppress Specific Error

Thanks, I thought as much, I just wanted to check to see if there was anything obscure I didn't know about.
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 419 views
  • 0 likes
  • 3 in conversation