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

If the column name has a single quote in it, you need to use literals, use double quotes and the n at the end. 

 

test = "&test"n;
ballardw
Super User

Assuming that at some point in this session you attempted to execute:

%let test = somestr'ng; 

Everything from that point on is likely suspect as you did not complete the assignment to test. The first single quote "ate" the semicolon until the next single quote appeared in your session.

 

 

So without a posting from the log of submitted code AND the error message and preferably posted into a code box to prevent the forum message windows from reformatting text it does not help very much to post random snippets from the log.

 

If you are using the enhanced editor and have reasonable code highlighting settings the text should give a clue something is happening.

%let test = somestr'ng'; 
%let somethingelse=blah;


%let test = somestr'ng; 
%let somethingelse=blah;

Notice that even the minimal highlighting in the code box shows the string enclosed with quotes in the first ling as a different color but in the third line with the single quote there is no highlight color. Indicates a quote issue. 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 16 replies
  • 6740 views
  • 2 likes
  • 5 in conversation