BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tom
Super User Tom
Super User

Your log does NOT have the full set of SAS code that was submitted. What version of Enterprise Guide are you using?  With version 6.1 you can change the settings by using menu  Tools -> Options to see the options window.  Then under Tasks -> Tasks General there is a check box for "Display all generated SAS code in task output".  Check that Box and hopefully you will see the line of text that the SAS log says has happened on line 49.

andrewm
Fluorite | Level 6

I would side with answers that point to macro comments as the likely issue.

I had a  [ %macro comment; ] statement followed by some unused code, having read here (http://www.sys-seminar.com/EE/Files/staceyphillips.pdf) that creating %macro comment and not calling the macro is a good way to comment out sections of code.

I used that approach, with a macro comment statement followed by some optional SAS code I did not intend to execute (that section included some regular commented out text, using * ... ; and /* ... */ methods).

The "NOTE 49-169" problem began immediately after running this macro-commented-out section. The only solution seemed to be restarting EG.

So, if you have any macro comment sections, or macros with comments in them, I suggest removing the macro comment and using some other method for commenting out that section of code, and/or experimenting with different types of comments within that macro to maybe pinpoint the problematic syntax.

p.s. A potentially better approach to using a macro for commenting out sections of SAS code is mentioned in this post, although I have not tested it (http://stackoverflow.com/questions/12011887/commenting-out-sections-of-code-for-testing).

dbianco
Calcite | Level 5

I know this is a late reply but I recently had this problem and found my issue. I am using SAS EG and ran part of a macro but didn't run the %mend. I then went to run all of my code and got the "NOTE 49-169" issue. SAS doesn't fully dump it's memory so the unbalance of not having %mend creates the note/error. This is why closing the program and then opening and re-running the program "fixes" the problem. A quick solution is to only run the line "%mend" which will generate an error. Ignore the error. Then try re-running all of your code and there should be no issues.

saskir
SAS Employee

Hello Paul_NYS,

 

The most common cause of this note is code that was submitted that contains unbalanced quotes.  The circumvention is to add the missing quote and save your code.   In Base SAS, you can try submitting the following line of syntax.  Most of the time this statement will allow SAS to recover from the missing quote and you will not have to restart SAS. 

 

;*%mend;*);*';*";**/;
run;

 

If the this does not allow SAS to recover, you will have to restart SAS.

 

If you are running in Enterprise Guide,  the circumvention is the same.  You will have to add the missing quote quote and save your code.  However,  EG automatically submits the above line of syntax that allows you to recover from the missing quote.  Simply resubmitting your code should allow you continue in the current EG session.  If you are still receiving the note even after correcting the unbalanced quotes, you will have to restart your EG session.  

 

As some of the folks who responded have mentioned, unbalanced quotes within a comment within a macro definition can also generate this note.   The note listed below goes into more detail, but basically, both asterisk-style and macro-style comments are still tokenized by SAS.  This means that an unmatched quote within these styles of comments is still seen as the start of a string literal.  SAS always expects a closing quote to end a string litteral. 

 

http://support.sas.com/kb/32/684.html

 

The best way to prevent problems with unmatched quotes contained within comments is to always use PL/1 style comments within a macro.  This type of comment is not tokenized so quotes are not seen as the start to a string literal. 

 

If the cause of the note is a quote within a comment, the circumvention is to change the comment to a PL/1 style comment and save your code.   You can then try and submit the following line of code to restore your SAS session.  If that does not allow you to recover, you will have to restart your SAS session.

 

;*%mend;*);*';*";**/;
run;

 

 

The final common cause for this issue is a quoted string that contains a macro variable that was created using a macro quoting function.  Below is a simple example.  This problem is most likely to occur when the macro variable is the last thing listed in the quoted string.

 

%_eg_hidenotesandsource;

5 %_eg_hidenotesandsource;

29

30 %let x=%str(test);

31

32 %put "This is a &x"abc;

NOTE: Line generated by the macro variable "X".

32 "This is a test

_______________

49

"This is a test"abc

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.

 

Macro quoting functions use special delta characters to mask any special characters found within the argument to the function.  These delta characters can sometimes be misinterpreted in non-macro code and cause unexpected problems.  The circumvention is to use the %UNQUOTE function to remove the delta characters.  

 

%put "This is a %unquote(&x)"abc;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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
  • 18 replies
  • 139377 views
  • 11 likes
  • 12 in conversation