DATA Step, Macro, Functions and more

Propcase with underscore in the second argument

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

Propcase with underscore in the second argument

Hi,

 

I need to check few symbols while applying PROPCASE on my data. Underscore is part of my symbols. When I included underscore in my code as O_NAM1 = PROPCASE(I_NAM1, " .<(+|&!$*);¬-/,%_`"), I got a warning "Apparent invocation of macro _ not resolved". How can I include underscore in my code? When I kept the underscore in single quotes, pgm considered single quote as a valid symbol and checked the data for single quote. I don't want to search data for single quote.

 

Thanks in advance!!

SAS@EMMAUS

Accepted Solutions
Solution
‎03-22-2017 09:10 PM
Super User
Posts: 5,497

Re: Propcase with underscore in the second argument

%_ would be a valid name for a macro.  To fix the problem, just switch the order within your string:  _% instead of %_

View solution in original post


All Replies
Solution
‎03-22-2017 09:10 PM
Super User
Posts: 5,497

Re: Propcase with underscore in the second argument

%_ would be a valid name for a macro.  To fix the problem, just switch the order within your string:  _% instead of %_

Occasional Contributor
Posts: 19

Re: Propcase with underscore in the second argument

Posted in reply to Astounding

Thank you!!

 

SAS@EMMAUS
Super User
Posts: 11,343

Re: Propcase with underscore in the second argument

Or use single quotes to delimit the string.

Occasional Contributor
Posts: 19

Re: Propcase with underscore in the second argument

Thank you!!
SAS@EMMAUS
☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 152 views
  • 0 likes
  • 3 in conversation