BookmarkSubscribeRSS Feed
jrine
Calcite | Level 5


Thank you for your assistance

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  A few comments. Are you expecting TABULATE to summarize the data and calculate the percents or have you "pre-summarized" the data and calculated the percents? The reason I ask is that you do not show what your INPUT data set (SBO_MEDATA) actually looks like. You show what PROC TABULATE is giving you. I am surprised that your posted code is working at all. I note several issues:

1) you have a mismatched quote as shown below:

    (AVG=' '*mean='Avg*f=dollar10.2))                        

                  -

                  |--mismatched single quote

  

should probably be:

    (AVG=' '*mean='Avg'*f=dollar10.2))

            

2) you use COUNT in the TABLE statement, but it does not appear in your CLASS or VAR statement, which I would expect would result in the following ERROR message. (Perhaps this should be LOANCOUNT)

ERROR: The type of name (Count) is unknown.

3) you also use AVG in the TABLE statement, but it does not appear in your CLASS or VAR statement,  (Perhaps this should be UPBAVG)

which I would expect would result in the following ERROR message.

ERROR: The type of name (AVG) is unknown.

It helps folks figure out what you really want, if you can show them working code and a sample of the input data -- you have shown an example of the output report, but without the other 2 pieces of the puzzle -- it is hard for anyone to provide really useful help. If you cannot post a sample of the input data, then either make some fake data (using a DATALINES section in a DATA step program) or use one of the existing SASHELP datasets to illustrate your code question.  For example, SASHELP.PRDSALE has a REGION variable with only 2 values, EAST and WEST; a COUNTRY variable with 3 values; a PRODTYPE variable with 2 values; numeric variables ACTUAL and PREDICT and date-based variables MONTH, YEAR and QUARTER.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1709 views
  • 3 likes
  • 2 in conversation