DATA Step, Macro, Functions and more

How to assign a name literal to the special character

Accepted Solution Solved
Reply
Contributor LL5
Contributor
Posts: 44
Accepted Solution

How to assign a name literal to the special character

I have a column name which calles  int'l that I want to assign a standard name literal.

I tried to put a single quatotion mark with a letter n like  'int'l'n,  but it was still not allowed in the data set.

Can anyone guide me on this?

 


Accepted Solutions
Solution
‎07-17-2016 12:09 PM
Respected Advisor
Posts: 3,156

Re: How to assign a name literal to the special character

You can't use single quotes to quote partial single quote, SAS will be confused. Try double quotes:

 

options validvarname=any;

data test;
input "int'l"n $;
cards;
test
;
run;

View solution in original post


All Replies
Solution
‎07-17-2016 12:09 PM
Respected Advisor
Posts: 3,156

Re: How to assign a name literal to the special character

You can't use single quotes to quote partial single quote, SAS will be confused. Try double quotes:

 

options validvarname=any;

data test;
input "int'l"n $;
cards;
test
;
run;
Super User
Posts: 19,878

Re: How to assign a name literal to the special character

Not sure how your using it, you can look at NLITERAL() function. 

Contributor LL5
Contributor
Posts: 44

Re: How to assign a name literal to the special character

Thanks Haikuo!
Contributor LL5
Contributor
Posts: 44

Re: How to assign a name literal to the special character

Thanks Reeza
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 274 views
  • 2 likes
  • 3 in conversation