Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

Scan function not working. why?

Posts: 49

Scan function not working. why?

11   data one;

12      string = ',leading, trailing,and multiple,,delimiters,,';

13      length word $20;

14   do until(word='');

15    count+1;

16    word=scan(string, count, ',', 'm');



ERROR 72-185: The SCAN function call has too many arguments.

17    output;

18   end;

Respected Advisor
Posts: 3,156

Re: Scan function not working. why?

Posted in reply to devarayalu

Works as being expected for me on SAS 9.2, Winxp 64bit.

65     data one;

66        string = ',leading, trailing,and multiple,,delimiters,,';

67        length word $20;

68     do until(word='');

69      count+1;

70      word=scan(string, count, ',', 'm');

71     output;

72     end;

73     run;

NOTE: The data set WORK.ONE has 1 observations and 3 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

Although after you stressed 'm' modifier, you only get one missing 'word'.


Super User
Super User
Posts: 7,050

Re: Scan function not working. why?

Posted in reply to devarayalu

Looks like you are running an older version of SAS where SCAN function does not support the modifiers.

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation