Hi, everyone.
Would you mind share me an usage example of %syscall scan() ? Thanks.
@whymath wrote:
Hi, everyone.
Would you mind share me an usage example of %syscall scan() ? Thanks.
Oh, there is actually a call scan() routine. Never used it ever.
After some try and error below appears to work.
%let string=abc def ghi;
%let cnt=2;
%let pos=0;
%let len=0;
%syscall SCAN(string, cnt, pos, len );
%put &=cnt &=pos &=len;
CNT=2 POS=5 LEN=3
@whymath wrote:
Hi, everyone.
Would you mind share me an usage example of %syscall scan() ? Thanks.
%syscall() is for using call routines on macro level, %sysfunc() for using functions on macro level.
scan() is a SAS function.
But...using %sysfunc() for the scan() function is not necessary as you've also got macro function %scan() for this.
%let string=abc def ghi;
%put test1: %sysfunc(scan(&string,2));
%put test2: %scan(&string,2);
28 %let string=abc def ghi; 29 %put test1: %sysfunc(scan(&string,2)); test1: def 30 %put test2: %scan(&string,2); test2: def
@whymath wrote:
Hi, everyone.
Would you mind share me an usage example of %syscall scan() ? Thanks.
I rarely use call scan() it all, so i don't have an example at hand. Do you mind explaining the task you are working on (including some data), so that we can try to provide an example? Will functions/call-routines in the macro-world: don't use any kind of quotes.
@whymath wrote:
Hi, everyone.
Would you mind share me an usage example of %syscall scan() ? Thanks.
Oh, there is actually a call scan() routine. Never used it ever.
After some try and error below appears to work.
%let string=abc def ghi;
%let cnt=2;
%let pos=0;
%let len=0;
%syscall SCAN(string, cnt, pos, len );
%put &=cnt &=pos &=len;
CNT=2 POS=5 LEN=3
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: