BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
robAs
Fluorite | Level 6

Hi all, A few years ago I recall seeing a new option which inserts commas in SAS log observation counts.  eg Instead of :
NOTE: The data set WORK.A has 345236011 observations and 3 variables.

We would see:

NOTE: The data set WORK.A has 345,236,011 observations and 3 variables.

I've tried searching for this in the SAS Docs but cant find the name of this sas option. Can anyone enlighten me?  
thanks rob

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kathryn_SAS
SAS Employee

The option is LOGNUMBERFORMAT.

86   options lognumberformat;
87   data test;
88   do i=1 to 1000;
89   output;
90   end;
91   run;

NOTE: The data set WORK.TEST has 1,000 observations and 1 variables.

View solution in original post

3 REPLIES 3
Kathryn_SAS
SAS Employee

The option is LOGNUMBERFORMAT.

86   options lognumberformat;
87   data test;
88   do i=1 to 1000;
89   output;
90   end;
91   run;

NOTE: The data set WORK.TEST has 1,000 observations and 1 variables.
Tom
Super User Tom
Super User

Thanks.  That option works with OPTIONS statement and GETOPTION() function. It does not work with the OPTIONS procedure however.  Even though the OPTIONS procedure has its own LOGNUMBERFORMAT optional keyword that you can add to the PROC OPTIONS statement.

 

Also note that numeric option values printed by the PROC OPTIONS procedure will that are modified by this LOGNUMBERFORMAT option will not work with the OPTIONS statement.

 

For example try:

options obs=max lognumberformat;
proc options option=obs; run;

You will get something like:

  OBS=9,223,372,036,854,775,807

printed to the SAS log.

 

If you then try to run

options   OBS=9,223,372,036,854,775,807 ;

The commas will generate errors.

Kathryn_SAS
SAS Employee

LOGNUMBERFORMAT is still considered internal and is not documented with PROC OPTIONS because it is limited in scope. It is only intended to affect the formatting of a limited number of numeric values in the log. It does not translate to other system or data set options, such as OBS= or FIRSTOBS=.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1155 views
  • 5 likes
  • 3 in conversation