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 :
Is that possible with a proc report without ordering / grouping the date ?
thanks
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
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;
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 Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.