s*******f 发帖数: 148 | 1 i'm trying to scan &syspbuff in order to assign the value to a macro
variable call &cc.
Usually i do it like this:
%macro m1 / parmbuff;
...
%let cc=%scan(&syspbuff,2);
...
%mend m1;
%m1(a,b,c,d,e)
Here &cc will be resolved to b.
But what if i would like to scan some strings with single quotes and commas?
such as:
%m1(%str('a','b','c')*%str('d','e'))
Here * is the delimiter (and i dunno if i treat it right with %str). I wanna
get the 'd','e' part as a whole from the scanning above.
I |
|
s*******f 发帖数: 148 | 2 Thanks for the reply! There's some strange problem when i use %qscan here:(
It does work great if i assign the string to a macro var with %let statement:
log:
3688 %let a=%str('a','b'*'c','d');
3689 %put temp1=%qscan(&a,1,*);
temp1='a','b'
3690 %put temp2=%qscan(&a,2,*);
temp2='c','d'
which is exactly what i want. However, for some reason, the scanned value
will include the single parenthesis in my macro program...
code:
%macro m1 / parmbuff;
...
%let cc=%qscan(&syspbuff,&i,*);
%p |
|
l***a 发帖数: 12410 | 3 not familiar with %qscan. do you want to try this?
%let cc=%qscan(&syspbuff,&i+1,*());
statement: |
|