Why can I not write the word "Total" in column1 of the summary row of a Proc Report?

Reply
Regular Contributor
Posts: 217

Why can I not write the word "Total" in column1 of the summary row of a Proc Report?

I am trying to write the word "Total" on the summary line of a proc Report the same way a proc Tabulate is doing.  I have read papers and books by McMahill (McMahill Booth), Zender, Carpenter and the Procedures Guide but I cannot make the Proc Report mimic the Proc Tabulate.  My code, with code to build a sample dataset are attached.

2764
2765  proc report data=work.HAVE nowd split='\';
2766    where plant_tech="&mfg" and cat_group="&cat_grp" and &dat12 <= jj_year_month <= &dat1;
2767    columns ("Plant/Technology:    &mfg. "("Categroy Group:        &cat_grp." jj_year_month
2768            (count_nc count_nc_lots count_tested_plus_nc_lots)));
2769          define jj_year_month  / group order=data 'J&J Year/Month'  format=dat. width=15;
2770          define count_nc        / sum 'No. NCs'            format=6.0;
2771          define count_nc_lots  / sum 'No. NC Lots'        format=6.0;
2772          define count_tested_plus_nc_lots / sum 'No. Lots Actioned' format=6.0;
2773          RBREAK AFTER / dol SUMMARIZE;
2774          compute after;
2775                if _break_ in ('_RBREAK_') then jj_year_month =  put(999999,dat.);
2776          endcomp;
2777  run;

NOTE: Character values have been converted to numeric values at the places given by: (Line)Smiley SadColumn).
      1:50
NOTE: Invalid numeric data, 'TOTAL:' , at line 1 column 50.
NOTE: Invalid numeric data, 'TOTAL:' , at line 1 column 50.
NOTE: Invalid numeric data, 'TOTAL:' , at line 1 column 50.
NOTE: There were 12 observations read from the data set WORK.HAVE.

Attachment
Super User
Super User
Posts: 6,500

Re: Why can I not write the word "Total" in column1 of the summary row of a Proc Report?

Change : jj_year_month =  put(999999,dat.);

to :  jj_year_month =  999999;

Since you already have the format attached to the column the value 999999 will display as "TOTAL".

Ask a Question
Discussion stats
  • 1 reply
  • 162 views
  • 0 likes
  • 2 in conversation