BookmarkSubscribeRSS Feed
Elf
Calcite | Level 5 Elf
Calcite | Level 5

Hello, Everyone,

 

 

I try to use _NUMERIC_ to change the output format of all numeric variables to avoid scientific notation. However, the code below doesn't work.

 

 

code.PNG

The result is: 

result.PNG

 

Thanks for your help.

2 REPLIES 2
Astounding
PROC Star

Just a few points to consider ...

 

If you are not going to use scientific notation, just how are you going to express 1345567 in only 4 characters?

 

_NUMERIC_ is still part of the software, however its meaning is mildly tricky when used in a DATA step.  There, it means "all the numeric variables that have been defined so far".  Since you put the FORMAT _NUMERIC_ statement before the SET statement, no numeric variables have been defined at that point.  So the FORMAT statement has no impact.  If you move it to after the SET statement, you will see a difference.

ballardw
Super User

Please post code in a code box opened using the forum {i} menu icon.

if we want to test some code it is much easier for us to copy it from the code box instead of having to completely retype code posted as a picture. If your example code runs more than a very few lines I doubt many of the users here will bother to retype it to test.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 2 replies
  • 682 views
  • 0 likes
  • 3 in conversation