Hi Guys . I am only interested in the underlined digits. I have tried with the compress and substr but no luck.
Example of data;
P2Pb 430 041017
P2P 10538 030517 DIBS
P2P 496 01092017
P2P 2594 01112016
thanks in advance.
data want; set have; want=input(scan(thedata,2," "),best.); run;
Note I assume your data is called have and the variable is thedata.
Post test data in the form of a datastep in the post using a code window, we cannot guess!!!!
Please post the code you tried, so that it is easier to suggest corrections. You can use the scan-function to get the second part of the string, then use the input-function to convert the extract to a number.
data want; set have; want=input(scan(thedata,2," "),best.); run;
Note I assume your data is called have and the variable is thedata.
Post test data in the form of a datastep in the post using a code window, we cannot guess!!!!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.