proc report slides
TRANSCRIPT
![Page 1: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/1.jpg)
Proc Report, the right tool for jobEric Gebhart
![Page 2: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/2.jpg)
Summary Reports
Statistics
Detail Reports
Compute Blocks
![Page 3: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/3.jpg)
PROC REPORT data= SAS-data-set options NOWD; COLUMNS variable_1 .... variable_n; DEFINE variable_1; . . . DEFINE variable_n;
COMPUTE blocks BREAK ... ; RBREAK ... ; RUN;
![Page 4: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/4.jpg)
Starting Simple
Columns
Define
![Page 5: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/5.jpg)
Proc Report data=sashelp.class nowd; columns name sex age height weight;
define name / display ‘Name’ width=10; define sex / display ‘Gender’ width=6; define age / display ‘Age’ width=4; define height / analysis ‘Height’ format=8.1; define weight / analysis ‘Weight’ format=8.1; run;
![Page 6: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/6.jpg)
![Page 7: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/7.jpg)
GROUP DISPLAY ANALYSIS ORDER ACROSS COMPUTED
Column Types
![Page 8: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/8.jpg)
Group & Compute
Mean Weight & Height
Compute a New Column
Summarize Mean
![Page 9: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/9.jpg)
Proc Report data=sashelp.class nowd; columns name sex age height weight ratio;
define name / display ‘Name’ width=10; define sex / display ‘Gender’ width=6; define age / display ‘Age’ width=4; define height / analysis mean ‘Height’ format=8.1; define weight / analysis mean ‘Weight’ format=8.1; define ratio / computed format=6.2; compute ratio; ratio = height.mean / weight.mean; endcompute; rbreak after / summarize; run;
![Page 10: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/10.jpg)
rbreak after / summarize;
![Page 11: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/11.jpg)
Group & Compute
Group by Sex
Break After Sex
![Page 12: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/12.jpg)
Proc Report data=sashelp.class nowd; columns sex name age height weight ratio;
define name / display ‘Name’ width=10; define sex / group ‘Gender’ width=6; define age / display ‘Age’ width=4; define height / analysis mean ‘Height’ format=8.1; define weight / analysis mean ‘Weight’ format=8.1; define ratio / computed format=6.2; compute ratio; ratio = height.mean / weight.mean; endcompute; break after sex / summarize; run;
![Page 13: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/13.jpg)
break after sex / summarize;
![Page 14: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/14.jpg)
Percentage of Weight
Column Alias
Analysis With No Print
Compute Before
Summarize with Style
![Page 15: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/15.jpg)
Proc Report data=sashelp.class nowd; columns sex name age height weight weight=weight2 weight_pct; define name / display ‘Name’ width=10; define sex / group ‘Gender’ width=6; define age / display ‘Age’ width=4; define height / analysis mean ‘Height’ format=8.1; define weight / analysis noprint ‘Weight’ format=8.1; define weight2 / analysis mean 'Weight' format=8.1; define weight_pct / computed '% of Weight' format=8.2; compute weight_pct; weight_pct = weight.sum / weight_sum; endcompute;
compute before sex; weight_sum = weight.sum; endcompute;
break after sex / summarize style=header; run;
![Page 16: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/16.jpg)
Weight2
![Page 17: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/17.jpg)
Percentage Bars
Slider Tagset
Style Over Rides
Slide bar Percentages
![Page 18: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/18.jpg)
ods tagsets.slider file='example6.html' style=slider;
Proc Report data=sashelp.class nowd ; columns sex name age height weight weight=weight2 weight_pct; define sex / group 'Gender' width=6; define name / display 'Name' width=10; define age / display 'Age' width=4; define height / analysis mean 'Height' format=8.1; define weight / analysis noprint format=8.1; define weight2 / analysis mean 'Weight' format=8.1; define weight_pct / computed '% of Weight'
format=Percent6. left style(column)=bar[tagattr="slider"];
![Page 19: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/19.jpg)
format=Percent6. leftstyle(column)=bar[tagattr="slider"];
![Page 20: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/20.jpg)
Survey Report
Survey Tagset
Group By Question
Order By Department
Line Statement
![Page 21: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/21.jpg)
cards;The computer I have is adequate for my needs Design 10 30 13% 50% 37% 2002The computer I have is adequate for my needs Marketing 20 30 10% 40% 50% 2002The computer I have is adequate for my needs Devel 10 50 19% 60% 21% 2002The computer I have is adequate for my needs Pubs 40 20 10% 67% 23% 2002The Software on my computer is always up to date Design 10 30 5% 48% 47% 2002The Software on my computer is always up to date Marketing 40 40 10% 50% 40% 2002The Software on my computer is always up to date Devel 10 30 23% 74% 3% 2002The Software on my computer is always up to date Pubs 50 60 17% 35% 47% 2002....
Simple Data
![Page 22: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/22.jpg)
PROC REPORT DATA=test SPLIT="/" HEADLINE HEADSKIP CENTER nowd;by year;
COLUMN question ( dept ( diff valid pct1 pct2 pct3 ) );define question / order noprint;DEFINE dept / ORDER FORMAT= $16. WIDTH=16 SPACING=2 LEFT "ITEMS" style=header;DEFINE diff / DISPLAY FORMAT= BEST9. WIDTH=9 SPACING=2 center "Diff % Fav";DEFINE valid / SUM FORMAT= BEST9. WIDTH=7 SPACING=2 center "Valid N" ;DEFINE pct1 / SUM FORMAT= PERCENT6. WIDTH=6 SPACING=2 center "Unfavorable" style=UnFav[tagattr="start"];DEFINE pct2 / SUM FORMAT= PERCENT6. WIDTH=6 SPACING=2 center "Neutral" style=Neutral[tagattr="in"];DEFINE pct3 / SUM FORMAT= PERCENT6. WIDTH=6 SPACING=2 center "Favorable" style=Fav[tagattr="end"];
break before question /;compute before question / style=Question[just=left] ; line question $80.;endcomp;
![Page 23: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/23.jpg)
![Page 24: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/24.jpg)
Drill Down Report
Summary Report
Detail Reports
Compute HyperLinks
![Page 25: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/25.jpg)
proc report data=work.bptrial nowd split='\';
column patient drug sex fever nausea rash reaction;
define patient / group; define drug / group; define sex / group; define fever / analysis sum noprint; define nausea / analysis sum noprint; define rash / analysis sum noprint; define reaction / computed 'Reaction?';
compute before patient; ptno + 1; endcomp;
compute patient; urlstring = "rephow2det.htm#pt" || left(put(ptno,3.0)); call define (_col_, 'url', urlstring ); endcomp;run;
Create a URLAnchor Counter
![Page 26: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/26.jpg)
ods html body = "rephow2det.htm" anchor = "pt1";
proc report data=work.bptrial nowd split='\';
column patient drug sex visitdate ("Blood Pressure" systolic slash diastolic) ("Reactions" fever nausea rash;
....
Anchor To Match
File To Match
![Page 27: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/27.jpg)
![Page 28: Proc Report Slides](https://reader034.vdocument.in/reader034/viewer/2022042513/544cf3cdaf7959f3138b49e2/html5/thumbnails/28.jpg)
http://support.sas.com/rnd/base/index.html
http://support.sas.com/rnd/base/index-ods-resources.html
http://support.sas.com/rnd/base/topics/odsmarkup/
Resources