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

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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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