10-22-2015 05:47 PM
My input field is something like this -
ALICE REV 2-KY/CB
and my output field needs to be somehting like this -
I have a vague idea about PRX functions. Any help will be appreciated.
10-22-2015 06:19 PM
Have a go with this sample, check the doc for the Tables of Perl Regular Expression (PRX) Metacharacters
data want; infile cards ; input text $64.; wordEnd = prxmatch("/\W+\b/", text); word = substr(text, 1, wordEnd-1); putlog _all_; cards; ALICE REV 2-KY/CB ALICE-REV 2/BHP Audition/BTT Audition-CK/BT ;
10-22-2015 06:50 PM
If you know the delimiters that might appear in your data, you can code this simply:
string = scan(string, 1, '- /');
Be sure to include a blank as one of the delimiters.