Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
@Robert, Thanks for your code, it works well.
@Expat, Thanks.. I was trying to extract data from a variable, so DLM & DSD infile options were not useful in this scenario.
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
@Peter Thanks for the link,
I had a look at the link before starting the topic, but I think the modifiers for SCAN function applies for latest release of SAS :S ..
We have SAS 9.1 and when I use the modifiers for the scan function it says,
Code:
ERROR 72-185: The COUNTW function call has too many arguments.
8 do count = 1 to nwords;
9 word = scan(string, count, delim, modif);
----
72
ERROR 72-185: The SCAN function call has too many arguments.
For the program,
Code:
data comma;
keep count word;
length word $30;
string = ',leading, trailing,and multiple,,delimiters,,';
delim = ',';
modif = 'mo';
nwords = countw(string, delim, modif);
do count = 1 to nwords;
word = scan(string, count, delim, modif);
output;
end;
run;
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
Quote:
I had a look at the link before starting the topic, but I think the modifiers for SCAN function applies for latest release of SAS :S ..
We have SAS 9.1