Assume I have a variable called "amount" and it has values like -15.59000, -1125.59000 etc and the format NLNUM18.5 has already been applied on that variable. Is there any way to verify that this variable is not displaying the values in exponential notation?
I find difficult to manually verify the values (it has over 10L unique values) for this variable.
Put the data into text, do a lengthn() function on it:
data test; length test $200; set have; test=put(nlnum,best.); check=lengthn(test); if check > 18; run;
Note, as always, post test data in the form of a datastep, I cannot test the above code.
Print the Variable amount into a text file.
In printing into text file SAS prints the value as it is displayed format in the table.
Search for E in the file.
This had worked for me.
If you have some E then try rounding off the value to your desired decimal places.
The function vvalue returns the formatted value of a variable. Maybe exporting the data can be skipped by using that function. Can't test it now, just an idea.
Put the data into text, do a lengthn() function on it:
data test; length test $200; set have; test=put(nlnum,best.); check=lengthn(test); if check > 18; run;
Note, as always, post test data in the form of a datastep, I cannot test the above code.
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.