I can't see your RTF file so I don't know exactly what you are producing, but when you say you want to produce a SAS table what exactly do you mean? Do you mean you want to create a dataset out of the output of your proc tabulate procedure?
As you created a data set want with that code then I have to assume that you need to modify that resulting data set to another format.
The are going to be issues that include transposing data to get variables to have names/label of the column headers that are currently in the variable named Type. You would also have to create single variable to hold the name of the statistic.
You might find it easer to use three proc tabulate statements and create the horsepower, train and origin summaries separately and modify each before appending. Note that if you want a line with "train" or "origin" with no actual values you would have to add them manually. Or at least different TABLE statements to select by table.
Some sorts of data sets aren't "easy" to make because they really don't make much sense. Have a single data set where one variable contains counts, a mean, a standard deviation, a max, a min and percentages is a problem waiting to happen when the set is used incorrectly. Errors involved with other manipulations, which would be the reason for a data set, are going to be extremely complex.
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.