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

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

View solution in original post

3 REPLIES 3
Satish_Parida
Lapis Lazuli | Level 10

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.

andreas_lds
Jade | Level 19

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.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 681 views
  • 1 like
  • 4 in conversation