Help using Base SAS procedures

proc tabulate - removing a column?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 105
Accepted Solution

proc tabulate - removing a column?

Hello all,

I have a table view I am creating with proc tabulate via the following code:

proc tabulate data=merged_field_qrm_rates_plot_zoom;

title "&Prodcat";

class 'date'n;

     var FB_short_rate FB_Rate FS_short_rate FS_Rate field_rate_FB field_rate_FS;

     table (FB_short_rate='Fed-Base Short Rate'

     FB_Rate='Product Yield - Fed-Base Scenario: QRM Model'

     field_rate_FB='Product Yield - Fed-Base Scenario: Field Forecast'

     FS_short_rate='Fed-Stress Short Rate'

     FS_Rate='Product Yield - Fed-Stress Scenario: QRM Model'

     field_rate_FS='Product Yield - Fed-Stress Scenario: Field Forecast')

     *(format=comma20.2),date;

          where prodcat="&Prodcat" and date in ('31DEC2012'd, '31MAR2013'd, '30JUN2013'd, '30SEP2013'd,'31DEC2013'd,

               '31MAR2014'd, '30JUN2014'd, '30SEP2014'd,'31DEC2014'd,              

              '31MAR2015'd, '30JUN2015'd, '30SEP2015'd,'31DEC2015'd,    

               '31MAR2016'd);

run;

And it looks as such:

                                                                                                                                   

Fed-Base Short Rate  Sum        0.510.560.560.560.560.560.660.660.761.061.261.461.762.01
Product Yield - Fed-Base Scenario: QRM Model     Sum0.240.270.300.320.330.330.350.370.410.500.620.740.881.03
Product Yield - Fed-Base Scenario: Field Forecast  Sum.0.230.230.230.230.250.260.290.360.520.680.821.03.
Fed-Stress Short Rate      Sum0.510.560.560.560.560.560.560.560.560.560.560.560.560.56
Product Yield - Fed-Stress Scenario: QRM Model    Sum0.240.270.300.320.330.330.330.330.330.330.330.330.330.33
Product Yield - Fed-Stress Scenario: Field Forecast  Sum.0.230.230.230.220.220.210.210.210.210.200.200.20.

This is all very good, except it is automatically adding this 'Sum' column. Is there anyway that I can just remove that sum column ?? The column variables I've defined on the far left are the appropriate description for the values, they are not sums.

Thanks!!

-Ryan


Accepted Solutions
Solution
‎06-14-2013 03:48 PM
Super User
Posts: 10,550

Re: proc tabulate - removing a column?

I think you want to remove the SUM label. Since you don't explicitly ask for a statistic it is defaulting to a sum as the requested statistic, you might want to add:

Keyword sum='';

You can modify or suppress statistic labels when included explicitly in the table statment by

sum='label text'

or

mean='' (that is two single quotes, not a double quote)

View solution in original post


All Replies
Solution
‎06-14-2013 03:48 PM
Super User
Posts: 10,550

Re: proc tabulate - removing a column?

I think you want to remove the SUM label. Since you don't explicitly ask for a statistic it is defaulting to a sum as the requested statistic, you might want to add:

Keyword sum='';

You can modify or suppress statistic labels when included explicitly in the table statment by

sum='label text'

or

mean='' (that is two single quotes, not a double quote)

Frequent Contributor
Posts: 105

Re: proc tabulate - removing a column?

I tried all 3 of your suggestions, but receive a syntax error for each:

keyword sum='';

                        _

                        22

                        200

ERROR 22-322: Syntax error, expecting one of the following: ;, /, ALL, COLPCTN, COLPCTSUM, CSS, CV, KURTOSIS, LCLM, MAX, MEAN,

              MEDIAN, MIN, MODE, N, NMISS, P1, P10, P25, P5, P50, P75, P90, P95, P99, PAGEPCTN, PAGEPCTSUM, PCTN, PCTSUM, PROBT,

              PRT, Q1, Q3, QRANGE, RANGE, REPPCTN, REPPCTSUM, ROWPCTN, ROWPCTSUM, SKEWNESS, STD, STDDEV, STDERR, SUM, SUMWGT, T,

              UCLM, USS, VAR. 

ERROR 200-322: The symbol is not recognized and will be ignored.

___________________________________________________________________________________________

mean='';

             ____

             180

ERROR 180-322: Statement is not valid or it is used out of proper order.

___________________________________________________________________________________________

sum='example text';

             ___

             180

ERROR 180-322: Statement is not valid or it is used out of proper order.

___________________________________________________________________________________________

Am I mistaken that I should have just added those statements within my proc tabulate statement, before the table statement?

Frequent Contributor
Posts: 105

Re: proc tabulate - removing a column?

Gahhhh disregard my last reply. I misunderstood, your suggestion worked.

Many thanks Ballard!!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 287 views
  • 0 likes
  • 2 in conversation