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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 265 views
  • 1 like
  • 3 in conversation