BookmarkSubscribeRSS Feed
nupedoc79
Fluorite | Level 6

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;
  uniqsub+eff_cnt.sum; 
 endcomp;
 
 compute after incent_plan_effdt;
  line @1 ipname $60. @62 'Count' @68 uniqsub 4. @79 uniqsub 4.;  
 endcomp; 

 compute before incentive_plan_name;
     ipname = incentive_plan_name;
  uniqmem = 0;
  uniqmem+plan_cnt.sum; 
    endcomp;

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

    compute before incentive_component_name;
     subcnt=0;
    endcomp;

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

 compute after subscriber_id;
     subcnt+1;
    endcomp;

    rbreak after / summarize ul ol;
 
run;
 

 

 

 

 

;

 

1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
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.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 803 views
  • 0 likes
  • 2 in conversation