data _null_; xyz='She sells seashells? Yes, she does.'; startposexp=1-23; whereisShe_ineg22=find(xyz,'She','i',startposexp); put whereisShe_ineg22=; run;
I should receive output whereisShe_ineg22=1 instead I am getting whereisShe_ineg22=14. why?Let me know.
You should be using a value of 1 for STARTPOSEXP. You are actually using a value of -22 (after performing math for 1 minus 23). So the software computes the starting position by moving backwards from the right-hand side of the string. Details are in the documentation for FIND.
She sells seashells? Yes, she does.
^
Position 22
^
Postion 14
So you started searching backwards ad the Y.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and save with the early bird rate—just $795!