The SAS Output Delivery System and reporting techniques

Preventing Duplication of Summary Data

Occasional Contributor
Posts: 11

Preventing Duplication of Summary Data

I'm new to Proc Report and ODS processing. How to I prevent duplication of data given the below code. The line in RED shouldn't print.


Physician  Component                        63         63             
Welcome to your Bible            Count  104        104             
Welcome to your Bible            Count  104        104             



proc report data=vbb_rpt out=vbb_out split='*' missing nowd;
 column incent_plan_effdt incentive_plan_name incentive_component_name last_name first_name subscriber_id
           subscriber_and_sfx relationship_code reward_earndt reward_type reward_amount
           incent_comp_achieve_earndt incent_comp_achieve_createdt elig_ruleset eff_cnt plan_cnt;
 define incent_plan_effdt / group 'Incentive Plan Eff Dt' width=22;
 define incentive_plan_name / group 'Incentive Plan Name' width=19;
 define incentive_component_name / group 'Incentive Component Name' width=25; 
 define last_name / order order=internal 'Last Name' width=9;
 define first_name / order order=internal 'First Name' width=10;
    define subscriber_id / group 'Subscriber Id' width=13;
 define subscriber_and_sfx  / group 'Member Id' width=14;
    define relationship_code / order order=data 'Relationship Code' width=17;
    define reward_earndt / order order=data'Reward Earned Dt' width=16;
 define reward_type / order order=data 'Reward Type' width=11;
 define reward_amount / order order=data 'Reward Amt' width=10 format=dollar5.2;
    define incent_comp_achieve_earndt / order order=data 'Incentive Component*Achievement Earn Dt' width=40;
 define incent_comp_achieve_createdt / order order=data 'Incentive Component*Achievement Created Dt' width=42;
 define elig_ruleset / order order=data 'Eligibility Classification' width=11;
 define eff_cnt / analysis sum noprint;
 define plan_cnt / analysis sum noprint;
    compute before incent_plan_effdt;
     uniqsub = 0;
 compute after incent_plan_effdt;
  line @1 ipname $60. @62 'Count' @68 uniqsub 4. @79 uniqsub 4.;  

 compute before incentive_plan_name;
     ipname = incentive_plan_name;
  uniqmem = 0;

 compute after incentive_plan_name;  
  line @1 incentive_plan_name $60. @62 'Count' @68 uniqmem 4. @79 uniqmem 4.;

    compute before incentive_component_name;

    compute after incentive_component_name; 
     line @10 incentive_component_name $30. @95 subcnt 4. @115 subcnt 4.;

 compute after subscriber_id;

    rbreak after / summarize ul ol;







Posts: 8,744

Re: Preventing Duplication of Summary Data

I don't see how your program is producing the output you posted. You have over 10 items listed in the column statement and you only show 3 items in your "what's wrong" example. You don't show your ODS destination or explain whether you are using LISTING or RTF or PDF or HTML and your code.

However, to help you debug, since you did not post any data that anyone could test with, my recommendation would be to alter your line statement like this:
line ...... keep everything the same ..... '~1x';

add a '~1x', '~2x','~3x' at the end of every LINE statement so you can figure out which line is the culprit.

My guess is that you have too many COMPUTE AFTER blocks or you are not setting some value to 0 correctly or you don't need the RBREAK AFTER.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation