Hi,
I have an output (FigA) but want it to look like (FigB) - any ideas?
(FigA)
| Yr | Mth | Product | Total |
| 2010 | 1 | D | 8445 |
| 2010 | 1 | R | 217 |
| 2010 | 1 | E | 7276 |
| 2010 | 2 | D | 322 |
| 2010 | 2 | R | 6845 |
| 2010 | 2 | E | 6508 |
| 2010 | 3 | D | 474 |
| 2010 | 3 | R | 7503 |
| 2010 | 3 | E | 6960 |
| 2011 | 1 | D | 6508 |
| 2011 | 1 | R | 6558 |
| 2011 | 1 | E | 6608 |
| 2011 | 2 | D | 6658 |
| 2011 | 2 | R | 6708 |
| 2011 | 2 | E | 200 |
| 2011 | 3 | D | 250 |
| 2011 | 3 | R | 900 |
| 2011 | 3 | E | 950 |
(FigB)
| Yr | Product | Total |
| 2010 | D | 9241 |
| R | 14565 | |
| E | 20744 | |
| 2011 | D | 13416 |
| R | 14166 | |
| E | 7758 |
Proc REPORT, TABULATE OR FREQ.
I'd probably start with TABULATE.
Tabulate works but I need it to be in an output file not a table. When I use OUT= it doesn't keep the format of the proc tabulate and instead refers back to original file.
Given your sample they should be the same structure.
You can try PROC MEANS or FREQ.
i recommend against including missing values in first column.
If you want this in a data set what is the purpose of the blank values for year?
What will you do with the resulting data set?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.