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. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 16 replies
  • 5545 views
  • 2 likes
  • 5 in conversation