In SAS, how do you find spaces in a macro variable?

How do you find the space position in a macro variable? For instance,

%let someString = the quick brown fox;
%let nextSpace = %index(&someString,' ');

The code above does not work. &nextSpacewill be 0. However, I suspect there must be a way to find the position of the space in the macro variable.

Many thanks!

+4
source share
1 answer
%let nextSpace = %index(&someString,%str( ));

Quotes, of course, do not work in macro variables. In this case, you need to use a macro, for example %str.

+6
source

Source: https://habr.com/ru/post/1542865/


All Articles