You might be able to use an NLMNLBRLw.d informat.
data example; x='R$123,456.78'; y= input(x,NLMNLBRL32.); run;
There is a corresponding form to display the values in the same form.
You need the LOCALE system option and an NLS informat.
554 data _null_; 555 x = 'R$100,50'; 556 y = input(x,NLMNY10.); 557 z = input(x,NLMNY10.2); 558 put (y z)(=NLMNY10.2); 559 put _all_; 560 run; y=R$100,50 z=R$100,50 x=R$100,50 y=100.5 z=100.5 _ERROR_=0 _N_=1
My oh my!! Guru @data_null__ How did you know that?
@data_null__ wrote:
You need the LOCALE system option and an NLS informat.
554 data _null_; 555 x = 'R$100,50'; 556 y = input(x,NLMNY10.); 557 z = input(x,NLMNY10.2); 558 put (y z)(=NLMNY10.2); 559 put _all_; 560 run; y=R$100,50 z=R$100,50 x=R$100,50 y=100.5 z=100.5 _ERROR_=0 _N_=1
This was where I started as well. But I remembered that there were some locale specific formats I had encountered (while looking for something else) and thought there might be a Brazil version. So I searched the formats documentation for Brazil an lo and behold, there is one.
You might be able to use an NLMNLBRLw.d informat.
data example; x='R$123,456.78'; y= input(x,NLMNLBRL32.); run;
There is a corresponding form to display the values in the same form.
@ballardw wrote:
You might be able to use an NLMNLBRLw.d informat.
data example; x='R$123,456.78'; y= input(x,NLMNLBRL32.); run;There is a corresponding form to display the values in the same form.
I believe this is the better option because you don't have to fiddle with LOCALE.
Much thanks @ballardw and @data_null__ . I learned something new. Great stuff!!!
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!
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.