DATA Step, Macro, Functions and more

%include ERROR

Reply
Frequent Contributor
Frequent Contributor
Posts: 139

%include ERROR

I ran this code all day yesterday without an issue. Today it won't run and I am getting this error message. I've seen messages on SAS support related to this issue but they were from 2014 and a paper written in 2012 suggested adding an extra semi-colon which did not work. I am using SAS Base 9.4 and the path is a network path and is correctly written and the file exists (again, worked all day yesterday). Does anyone know why this could be happening with SAS 9.4. None of my %put statements are resolving either. It seems like SAS is just malfunctioning its macro utility.

 

4663 %include "&path.Plot Workbook.sas" ;
ERROR: Incorrect %INCLUDE statement will not be executed. There is a syntax error.
4664 %include "&path.Plot Workbook.sas" ;;
ERROR: Incorrect %INCLUDE statement will not be executed. There is a syntax error.

Super User
Posts: 9,612

Re: %include ERROR

Use the {i} icon to copy/paste log snippets to. Only then can we be sure we get all text exactly as it was written to the log by SAS.

The main posting window will drop or change certain characters.

You might als post the code as you ran it, the log might not have all relevant text in it.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Posts: 9,612

Re: %include ERROR

And take a close look at the contents of &path.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Super User
Posts: 9,227

Re: %include ERROR

Its likely you have submitted code which is incorrect, and has not been terminated.  By this I mean code you have submitted is still in effect.  For instance, if you submit code with only one quote mark, and don't close the quote mark, the quote mark from before is still in effect.  This can happen when you macros do no resolve to valid code, or leave text strings unclosed etc.  The simplest way to solve this is to start a new session.  Then QC the code you are running thoroughly (you will have a QC process won't you!), you will likely find some code being generated incorrectly or not as expected, and that is hanging on after the run has finished.

Super User
Super User
Posts: 7,860

Re: %include ERROR

Check out this other thread

https://communities.sas.com/t5/Base-SAS-Programming/resolve-macro-variable-in-include-statement/td-p...

 

It looks like you can get that error message when the filename you are trying to include is not in a valid format for the operating system you are using.

Ask a Question
Discussion stats
  • 4 replies
  • 217 views
  • 0 likes
  • 4 in conversation