BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mathis1
Quartz | Level 8

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 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
ed_sas_member
Meteorite | Level 14

Hi @Mathis1 

 

Please try the NLMNLEURw.d informat:

 

data WANT;
	set HAVE;
	NEW=input(var,NLMNLEUR8.2);
run;

Best,

View solution in original post

2 REPLIES 2
ed_sas_member
Meteorite | Level 14

Hi @Mathis1 

 

Please try the NLMNLEURw.d informat:

 

data WANT;
	set HAVE;
	NEW=input(var,NLMNLEUR8.2);
run;

Best,

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 2 replies
  • 538 views
  • 0 likes
  • 3 in conversation