...
> this assingment works in sas.
> %let arr = 'aaa', 'bbb', 'ccc';
>
> The "arr" variable contains the array of 3 strings?
> Or it contains only one long string?
It is a value that is assigned to a macro variable. Macro variables store text, or a string of characters.
> Because when i pass the "arr" variable to %substr
> function, it fail because the variable contains
> comma, which is also separator in function
> arguments.
Yes, this is expected.
> My question is
...
> - in case it is only one string, how can i handle
> special character (comma) in the string?
By quoting, that is, hiding the comma's from macro processor.
%let arr = %str('aaa', 'bbb', 'ccc');
%put first word = %scan(&arr, 1, %str(,));
%put second word = %scan(&arr, 2, %str(,));
%*-- on log
first word = 'aaa'
second word = 'bbb'
--*;
... View more