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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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