BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AllSoEasy
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

3 REPLIES 3
ballardw
Super User

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)

AllSoEasy
Obsidian | Level 7

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?

AllSoEasy
Obsidian | Level 7

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

Many thanks Ballard!!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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