Hi everyone!
Maybe exist a way to disable the autogenerated variables when a user executes a task in SAS Studio?
We want to avoid this:
We appreciate the support you can provide us!
If you start a new session, and run a task, do you get that Note?
I tried to replicate the problem, but I couldn't, even with code like:
1 %let foo=%bquote(blah'AAA BBB CCC'blah) ;
2 %put &foo ;
blah'AAA BBB CCC'blah
The only way I could get that NOTE in the log is if I introduce an unmatched quotation mark, as suggested in this thread:
https://communities.sas.com/t5/SAS-Programming/quot-NOTE-49-169-The-meaning-of-an-identifier-after-a...
I was able to replicate the case, It works!
;*%mend;*);*';*";**/;
run;
Now, we want to replicate this for all users that use SAS Studio, I can't do that in workspace autoexec.sas code because It should be place at the beginning of the user's code, may be exist another place to do that?
You can turn that note off by adding this option to your SAS server AUTOEXEC - this will enable it for all users:
options noquotelenmax;
That's what we do and it works fine.
I don't think noquotelenmax will effect the note about text immediately following a quoted string, e.g.:
1 options noquotelenmax;
2 %let foo='bar'foo ;
-----
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.
True, but it isn't clear which issue the OP has: an embedded quote or simply a long end-quoted string - the option can deal with those.
@_zeta_ wrote:
I was able to replicate the case, It works!
;*%mend;*);*';*";**/;
run;Now, we want to replicate this for all users that use SAS Studio, I can't do that in workspace autoexec.sas code because It should be place at the beginning of the user's code, may be exist another place to do that?
You cannot fix user generated unbalanced quotes (or unbalanced macro defintions) in the autoexec.sas file. The problem hasn't happened yet when the autoexec file executes.
@_zeta_ wrote:
I was able to replicate the case, It works!
;*%mend;*);*';*";**/;
run;Now, we want to replicate this for all users that use SAS Studio, I can't do that in workspace autoexec.sas code because It should be place at the beginning of the user's code, may be exist another place to do that?
I'm surprised Studio isn't already appending that magic string after each block of user submitted code. That's what EG does.
Personally, I think automatically fixing unmatched quotes can be confusing to developers. It can end up hiding the problem, because the IDE fixes it.
So I would recommend handling this as an education issue, and inform users that if if they receive the error you mentioned, they likely have a problem with unmatched quotes. And they can either try submitting the magic string to fix the problem, or they can exit their SAS session and re-start it.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.