This is the full code of my 'Proc Report'. proc report data = logs3 (where = (datepart(actual_start) ge &runmonth)) style(summary)=[background=yellow] nowd split = '*' headskip; column workflow_name id2 id actual_start actual_start=startmin actual_start2 session_timestamp session_timestamp=endmax duration time last_duration avg_duration successful_rows last_rows diff_from_last_rows avg_rows row_diff_from_avg pct_diff_from_avg FAILED_SOURCE_ROWS next_place last_error_code ; define workflow_name / display noprint; define id2 / group noprint; define startmin / min f=datetime16. '*Start Time'; define endmax / max f=datetime16. '*End Time';; define id / display style = [background=lightgreen flyover=$idname.] ''; define actual_start / order noprint; define actual_start2 / computed noprint f= datetime16. '*Start Time'; define session_timestamp / display noprint f= datetime16. '*End Time'; define duration / analysis noprint f= time12.2 '*Run Time';; define time / computed f= time12.2 '*Run Time'; define last_duration / display f= time12.2 'Previous*Run Time'; define avg_duration / display f= time12.2 'Average*Run Time'; define successful_rows / analysis f= comma12. 'Rows*Processed'; define last_rows / analysis f= comma12. 'Rows*Last Month'; define diff_from_last_rows / analysis f= comma12. 'Diff From*Last Month'; define avg_rows / display f= comma12. 'Average*Rows'; define row_diff_from_avg / display noprint f= comma12. 'Diff From*Avg Month'; define pct_diff_from_avg / display f= percent6.2 '% Diff of*Avg Month'; define next_place / display noprint; define failed_source_rows / analysis f= comma12. 'Failed*Rows'; define last_error_code / display 'Error*Code'; break after id2 / page summarize; * Because I want to show all values, even those equal to the ; * previous value, I used this: ; * http://support.sas.com/kb/24/322.html ; compute actual_start2; if actual_start ne . then hold = actual_start; actual_start2 = hold; endcomp; compute before ; alltime = 0; endcomp; compute before _page_ / style = {just=l FONTWEIGHT=bold color=blue backgroundcolor=palegreen}; txt = upcase(compbl(cat(workflow_name,' --> ',scan(id2,2,' ')))); if workflow_name = scan(id2,2,' ') then txt = upcase(workflow_name); line txt $75.; endcomp; compute id; if id in ('A1','C10','D1','J7','K27','L6','Q_R','U15' 'W6A','W6B') then call define(_row_, "style", "style=[backgroundcolor=lightgrey]"); endcomp; compute time; time = endmax - startmin; call define(_col_, "style", "style=[background=lightblue font_weight=bold]"); endcomp; compute pct_diff_from_avg; call define(_col_, "style", "style=[color=tlight. font_weight=bold]"); endcomp; compute diff_from_last_rows; call define(_col_, "style", "style=[color=tlight. font_weight=bold]"); endcomp; compute successful_rows; call define(_col_, "style", "style=[background=wheat font_weight=bold]"); endcomp; compute last_rows; call define(_col_, "style", "style=[background=KHAKI font_weight=bold]"); endcomp; compute after _page_ / style = {just=l FONTWEIGHT=bold color=blue backgroundcolor=white}; txt = cat('Next Up: ',next_place); line txt $175.; endcomp; compute after id2; *call define(_row_,"style", " style = [background=yellow]"); tottime = endmax-startmin; days = floor((tottime)/(24*60*60)); hours = hour(tottime); minutes = minute(tottime); seconds = second(tottime); theline = compbl(cat(put(days,z2.),' days ', put(hours,z2.),' hours ',put(minutes,z2.),' minutes ', put(seconds,z2.),' seconds')); alltime = alltime+tottime; adays = floor((alltime)/(24*60*60)); ahours = hour(alltime); aminutes = minute(alltime); aseconds = second(alltime); thealine = compbl(cat(put(adays,z2.),' days ', put(ahours,z2.),' hours ',put(aminutes,z2.),' minutes ', put(aseconds,z2.),' seconds')); line @1 'Group Time: ' +3 theline $char75.; line @1 'Total Time: ' +4 thealine $char75.; endcomp; compute last_error_code; if last_error_code gt 0 then do; call define(_row_, "style/merge", "style=[background=errcol. font_weight=bold]"); end; endcomp; run;
... View more