BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
blast
Calcite | Level 5

Hi , 

I have a very simple question on the proc report.

data have;
format date ddmmyy10.;
input date  nature :$20. montant ;
datalines;
12926 test 	100
14926 test 	200
18926 test2 500
25926 test2 50
;
run;

proc report data=have ;
column ("Flux " date nature montant);
define date 		/ display 'Date de Saisie';
define nature  		/ display 'Type';
define montant    	/ display 'Mt';
run;

I want to had on the botom 2 subtotal lines, like this :  

 

Capture1.JPG

 

Is that possible with a proc report without ordering / grouping the date ?  

 

thanks 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

HI:

  As an alternative, here's how you would achieve the report just using some "helper" variables and PROC REPORT with COMPUTE blocks. In this example, #1 and #2 are just the steps that lead to #3, which is the final report. This PROC REPORT is based on using the helper variables, as created in the modified DATA step program.

Cynthia_sas_0-1669320770770.png

Cynthia

View solution in original post

2 REPLIES 2
Ksharp
Super User

It is not right way to do this within a PROC REPORT.

You need pre-process your data before PROC REPORT.

 

 

data have;
format date ddmmyy10.;
input date  nature :$20. montant ;
datalines;
12926 test 	100
14926 test 	200
18926 test2 500
25926 test2 50
;
run;

proc report data=have ;
column ("Flux " date nature montant) dummy;
define date 		/ display 'Date de Saisie';
define nature  		/ display 'Type';
define montant    	/ display 'Mt';
define dummy/computed noprint;
compute dummy;
if nature='test' then test+montant;
if nature='test2' then test2+montant;
endcomp;
compute after/style={just=l};
line ' ';
line   'Total' @25 'test' @35 test;
line   'Total' @25 'test2' @35 test2;
endcomp;
run;

Ksharp_0-1669262034171.png

 

Cynthia_sas
SAS Super FREQ

HI:

  As an alternative, here's how you would achieve the report just using some "helper" variables and PROC REPORT with COMPUTE blocks. In this example, #1 and #2 are just the steps that lead to #3, which is the final report. This PROC REPORT is based on using the helper variables, as created in the modified DATA step program.

Cynthia_sas_0-1669320770770.png

Cynthia

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 2 replies
  • 535 views
  • 1 like
  • 3 in conversation