Hello,
I have a character variable under this form :
61.39€
47.32€
124.45€
12.3€
and i'd like to convert it into a numeric variable under that form :
61.39
47.32
124.45
12.3
I tried this code :
Data WANT;
Set HAVE;
NEW=input(strip(scan(VAR,-1,"€")), 5);
run;
but i don't get what i want. I only get the price with three digits before the comma. Moreover those prices are only displayed with one decimal instead of 2.
thank you for your help 🙂
Hi @Mathis1
Please try the NLMNLEURw.d informat:
data WANT;
set HAVE;
NEW=input(var,NLMNLEUR8.2);
run;
Best,
Hi @Mathis1
Please try the NLMNLEURw.d informat:
data WANT;
set HAVE;
NEW=input(var,NLMNLEUR8.2);
run;
Best,
Try
NEW = input(compress(VAR,"€"),10.);
Increase the informat width as needed.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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 lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.