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=.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 738 views
  • 5 likes
  • 3 in conversation