Remove last word from string in SAS? -


i have list of counties in dataset (calhoun county, el paso county, etc.) , return dataset has word 'county' stripped (calhoun, el paso, etc.) there easy way in sas? thank you!

call scan report position of nth word, can use substr. count=-1 end rather beginning.

data _null_;   starting_word='el paso county';   count=-1;   call scan(starting_word, count, pos, length);   end_word=substr(starting_word,1,pos-2); *pos 'c' two;   put end_word=; run; 

Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -