obs PARK ST YRESTAB ACRES 1 Arches UT 1971 73000 2 Canyonlands UT 1964 338000 3 Capitol Reef UT 1971 242000 4 Zion UT 1919 147000 5 Bryce Canyon UT 1924 36000 Hello. I was told to remove the word "Canyon" in "PARK". So this is what I did: DATA UT; Infile 'C:\SAS\natlpark.txt'; PARK $ 1- 20 ST $ 21-22 YRESTAB 25-28 ACRES COMMA10.; If st ^= "UT" then delete; Acres = round(acres,1000); t = indexw(park, 'Canyon')'; If t then PARK = substr(park,1,t-1); run; proc print data=UT; run; obs PARK ST YRESTAB ACRES t 1 Arches UT 1971 73000 0 2 Canyonlands UT 1964 338000 0 3 Capitol Reef UT 1971 242000 0 4 Zion UT 1919 147000 0 5 Bryce UT 1924 36000 7 As you can see I successfully removed the word Canyon from "Bryce Canyon", but from observation 2 the word "Canyonlands" still carries with it the word "Canyon" at the front. I tried using the split(), scan(), but it gives me weird answers. How can I remove the word Canyon in Canyonlands??
... View more