Hello,
I tried to output the following simple frequency table based on proc freq to excel using proc report. However proc report procedures adding up the count even I change the count as count_ , percent as pct.
Any way to prevent that?
nvis count percent
. 20 20
5 10 10
8 70 70
HINT: Always show the code of what you attempted.
It may be that you are very close or need much work to do something but without details it is pretty hard to tell. Copy the code from the editor, on the forum open a text box using the </> icon that appears above the message window and paste the text. The text box serves a couple purposes. One, the message windows will reformat text and may result in code that will not run if copy/paste from the forum. Second, it sets text apart from questions or comments.(See below).
I am going to guess that you did not provide a roll in a DEFINE statement for the variables Count and Percent. If you do not then the default behavior for numeric values is to treat them as variables to Sum.
To display just the values you already have you would use something like
define count / display; define percent /display.
HINT: Always show the code of what you attempted.
It may be that you are very close or need much work to do something but without details it is pretty hard to tell. Copy the code from the editor, on the forum open a text box using the </> icon that appears above the message window and paste the text. The text box serves a couple purposes. One, the message windows will reformat text and may result in code that will not run if copy/paste from the forum. Second, it sets text apart from questions or comments.(See below).
I am going to guess that you did not provide a roll in a DEFINE statement for the variables Count and Percent. If you do not then the default behavior for numeric values is to treat them as variables to Sum.
To display just the values you already have you would use something like
define count / display; define percent /display.
you could also use the put function to convert the numbers from proc freq to character variables. that's usually how I do it when I create my tables.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.