Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Proc Report summary statisistics

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 12-19-2017 06:45 AM
(1479 views)

I am trying to create a report using proc report where in I have grouped by a variable named probability and inside the groupped variable is another variable Account_name which is a character variable. I want to the frequency of this variable for each group of probability

eg-

probability Accounts

1 3

0.9 4

0.8 6

and so on, but i am not able to do that because it displays all the account_Names inside each probability rather than the freuency/count of the column

what i am getting is

probability accounts

1 LG

max

LF

0.9 GH

PL

and so on

following is the code I used-

```
proc report data= c1.o;
columns probability____ Account_Name Total_Media_Value Forecasted_Budget;
define probability____ / group order descending 'Probability';
define Account_Name/ n 'Accounts';
define Total_Media_Value /sum 'Total_Budget';
define Forecasted_Budget/ computed 'Forecasted Budget';
compute Forecasted_Budget;
Forecasted_Budget= (Total_Media_Value.sum)*(probability____);
endcomp;
run;
```

in the define Account_Name line i have used display and analysis as well but no use

i get the error

ERROR: Account_Name is an ANALYSIS variable but not numeric.

- Tags:
- proc report

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

PROC SUMMARY will give you frequencies in a dataset, it can sum the Total_Media_Value, and so on. If you need to compute percentages from those frequencies this is also done easily in a SAS data step. I find it much easier to do manipulations in a SAS data step than getting the math correct in PROC REPORT.

--

Paige Miller

Paige Miller

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@RW9 wrote:

I agree with this. Getting the data computed properly before you run PROC REPORT will make your life sooooooo much simpler.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

issue is proc freq wont work if done before. How do you suggest that would solve the problem?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

PROC SUMMARY will give you frequencies in a dataset, it can sum the Total_Media_Value, and so on. If you need to compute percentages from those frequencies this is also done easily in a SAS data step. I find it much easier to do manipulations in a SAS data step than getting the math correct in PROC REPORT.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

PROC TABULATE may be what you're looking for.

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.