Hi,
I created a report with proc report.
Per day, I have parcels in and out. Some packages have deadlines to respect (priority 1 ...). By priority, I count the number of packets processed within the time limit and those that did not respect the time limit.
I am using the "break after" function to get the totals by week.
I would like to add a line (under the totals per week), in yellow on the photo, allowing to calculate the percentages by priority.
For example, 58,82% = 10 / (10+7)
Is-it possible with the proc report ?
Thanks,
Yes. Post sample data to get a usable code answer 🙂
An example :
DATA test;
LENGTH
Priorite $ 10
Date 8
semaine $20.
OK 8
KO 8;
FORMAT
Priorite $CHAR10.
Date DDMMYY10.
semaine $20.
OK 8.
KO 8.;
INFORMAT
Priorite $CHAR10.
Date DDMMYY10.
semaine $20.
OK 8.
KO 8.;
INPUT
Priorite : $CHAR10.
Date : DDMMYY10.
semaine : $20.
OK : 8.
KO : 8.;
CARDS;
P1 08/02/2021 6 1 0
P1 08/02/2021 6 1 0
P1 08/02/2021 6 0 1
P1 08/02/2021 6 1 0
P1 08/02/2021 6 0 1
P1 08/02/2021 6 1 0
P2 08/02/2021 6 0 1
P2 08/02/2021 6 1 0
P2 08/02/2021 6 1 0
P2 08/02/2021 6 1 0
P1 09/02/2021 6 1 0
P1 09/02/2021 6 1 0
P1 09/02/2021 6 0 1
P1 09/02/2021 6 0 1
P1 09/02/2021 6 1 0
P1 09/02/2021 6 1 0
P1 09/02/2021 6 0 1
P1 09/02/2021 6 1 0
P2 09/02/2021 6 0 1
P2 09/02/2021 6 1 0
P2 09/02/2021 6 1 0
P2 09/02/2021 6 0 1
P2 09/02/2021 6 1 0
P2 09/02/2021 6 1 0
P2 09/02/2021 6 1 0
P2 09/02/2021 6 0 1
P2 09/02/2021 6 1 0
P2 09/02/2021 6 1 0
P2 09/02/2021 6 1 0
P2 09/02/2021 6 1 0
;
run;
proc report data=test nowd;
column semaine date;
column priorite, (ok ko);
define date / group missing '';
define semaine / group missing 'Semaine';
define priorite / across missing "";
define ok / analysis SUM "OK";
define ko / analysis SUM "KO";
break after semaine / summarize;
compute after semaine;
if upcase(_break_) = 'SEMAINE' then do;
semaine="Semaine " ||semaine;
end;
endcomp;
run;
Code currently using as well.
Sorry, I don't understand
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.