/*-------------------------------------------------------------------*/ /* SAS Guide to Report Writing: Examples */ /* Publication book code: 55045 */ /* */ /* Each sample begins with a comment that states the example and */ /* page number where the code is shown. In some cases, complete raw */ /* data or DATA steps that built input data sets are shown in the */ /* appendix. In this file, the complete raw data and DATA steps are */ /* shown with the report-writing code in the examples. */ /*-------------------------------------------------------------------*/ /* This code is shown in Example 1 on page 4. */ options nodate number pageno=1 linesize=132 pagesize=60; data housing; input zone $1. +1 type : $8. bedr bath sqfeet age schools : $15. / address & $25. price; cards; 4 twostory 4 2.5 2538 6 920:340/400/368 211 Whitehall Way 154900 1 twostory 4 2.5 2700 7 920:470/360/552 1800 Bridgeport 169900 3 twnhouse 2 2 1595 6 320:332/366/312 154 Montrose 102000 1 twostory 3 2.5 2750 0 920:628/388/348 4000 Skipjack Ct. 214900 4 split 3 2 1306 0 920:576/512/436 5933 South Downs Dr. 95400 2 twostory 3 3.5 2590 0 920:364/608/368 727 Crabtree Crossing 292400 5 split 3 1 1959 31 680:308/316/332 627 Riverside Dr. 58900 2 twnhouse 3 2.5 1374 15 920:304/604/368 907 Lexington Ct. 65500 4 condo 2 2 1275 5 920:448/472/318 6010-102 Winterpoint 70000 4 ranch 3 2 1526 6 920:476/424/428 6509 Orchard Knoll 107900 1 split 3 1.5 1329 23 920:396/360/552 500 E. Millbrook Rd. 82900 1 condo 3 2.5 1300 5 920:448/472/318 6010-101 Winterpoint 68900 8 twnhouse 2 2 1120 4 320:364/366/312 521 Woodwinds 84600 2 condo 2 2 1066 1 920:520/604/368 1324 Killiam Ct. 74900 4 split 4 2.5 2600 10 920:476/424/428 7141 Eastridge 198000 2 twnhouse 2 1.5 1150 15 920:304/400/368 1239 Donaldson Ct. 49900 4 ranch 3 2.5 2441 1 920:540/512/436 9354 Sauls Rd. 197000 1 split 3 1 1245 36 920:524/388/348 2414 Van Dyke 85000 7 twnhouse 2 1.5 1280 4 920:584/592/588 409 Galashiels 60000 4 ranch 3 3 2400 2 920:420/424/428 8122 Maude Steward Rd. 129900 2 duplex 2 2.5 1184 4 920:364/604/368 112 Lake Hollow 67900 6 duplex 3 1 1569 73 350:324/328/336 108 South Elm St. 100000 2 twnhouse 2 1.5 1040 9 920:414/604/316 216 Concannon Ct. 59900 4 condo 3 2 1448 5 920:448/472/318 6000-102 Winterpoint 79900 2 twnhouse 3 2 1471 1 920:364/604/368 765 Crabtree Crossing 184000 4 twostory 3 2.5 1940 4 920:328/312/316 1641 Pricewood Lane 195000 5 split 2 1 960 2 680:308/304/332 Rt.5 Yarbororugh Rd. 78900 8 twnhouse 2 2 1167 5 320:364/366/312 5001 Pine Cone 78500 2 condo 2 2 1246 4 920:364/604/316 721 Springfork 76900 1 twnhouse 2 1 980 4 920:304/360/552 1203 Berley Ct 72400 8 twostory 4 2.5 3446 0 320:313/316/356 Lot 10 Red Coach Rd. 225000 8 split 3 1.5 1441 28 320:315/316/356 5617 Laurel Crest Dr. 86900 5 twostory 3 2.5 1900 4 680:308/316/332 1532 St. Mary's Rd. 118500 8 split 3 2 1976 10 320:348/316/356 110 Skylark Way 123500 8 twnhouse 2 2 1276 6 321:360/304/356 8 Stonevillage 71000 5 split 3 2 1533 5 680:308/316/322 603 Greentree Dr. 117800 2 twostory 4 2.5 2584 0 920:364/640/368 114 Grey Horse Dr. 189900 8 twostory 4 2.5 2608 0 320:362/366/312 2103 Carriage Way 189900 2 twnhouse 3 2.5 2080 4 920:530/400/318 108 Chattle Close 179900 5 twostory 3 2.5 2863 7 680:308/316/332 5521 Horseshoe Circle 199200 8 split 2 2.5 2900 38 320:315/316/356 2617 Snow Hill Rd 425000 3 twostory 4 2.5 3926 5 320:362/366/312 49 Birn Ham Lane 360000 4 split 3 1 1010 28 920:432/404/436 4341 Rock Quarry 60000 1 split 3 2 1662 12 920:488/360/552 6324 Lakeland, Lake Park 100000 2 split 3 2 2004 0 920:568/400/318 101 Meadowglade Ln. 179950 2 twostory 3 2.5 1650 0 920:364/608/368 100 Cumberland Green 143000 1 twostory 3 2.5 2416 6 920:568/356/318 6008 Brass Lantern Ct. 144500 4 ranch 3 2.5 2441 1 920:540/512/436 9356 Sauls Rd. 197000 1 twostory 5 3.5 4850 3 920:540/512/436 9317 Sauls Rd. 339950 4 split 3 1.5 1225 18 920:328/312/316 6424 Old Jenks Rd. 81900 ; proc sort data=housing; by descending price; run; proc format; value $zonefmt '1'='North Ridge' '2'='Inside Beltline' '3'='Southside' '4'='East Lake' '5'='Westend' '6'='Mountain Brook' '7'='Ensley' '8'='Roebuck'; run; proc print data=housing uniform label noobs; where price between 100000 and 250000; var zone type address price bedr bath sqfeet age; format sqfeet comma5. price dollar9. zone $zonefmt.; label bedr='BEDROOM'; title 'Selected Listing of Local Residential Properties'; title2 'Price Range $100,000 to $250,000'; run; /* This code is shown in Example 2 on page 8. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. */ options nodate pageno=1 fmtsearch=(reports); libname reports 'SAS-data-library'; data reports.housing; input zone $1. +1 type : $8. bedr bath sqfeet age schools : $15. / address & $25. price; cards; 4 twostory 4 2.5 2538 6 920:340/400/368 211 Whitehall Way 154900 1 twostory 4 2.5 2700 7 920:470/360/552 1800 Bridgeport 169900 3 twnhouse 2 2 1595 6 320:332/366/312 154 Montrose 102000 1 twostory 3 2.5 2750 0 920:628/388/348 4000 Skipjack Ct. 214900 4 split 3 2 1306 0 920:576/512/436 5933 South Downs Dr. 95400 2 twostory 3 3.5 2590 0 920:364/608/368 727 Crabtree Crossing 292400 5 split 3 1 1959 31 680:308/316/332 627 Riverside Dr. 58900 2 twnhouse 3 2.5 1374 15 920:304/604/368 907 Lexington Ct. 65500 4 condo 2 2 1275 5 920:448/472/318 6010-102 Winterpoint 70000 4 ranch 3 2 1526 6 920:476/424/428 6509 Orchard Knoll 107900 1 split 3 1.5 1329 23 920:396/360/552 500 E. Millbrook Rd. 82900 1 condo 3 2.5 1300 5 920:448/472/318 6010-101 Winterpoint 68900 8 twnhouse 2 2 1120 4 320:364/366/312 521 Woodwinds 84600 2 condo 2 2 1066 1 920:520/604/368 1324 Killiam Ct. 74900 4 split 4 2.5 2600 10 920:476/424/428 7141 Eastridge 198000 2 twnhouse 2 1.5 1150 15 920:304/400/368 1239 Donaldson Ct. 49900 4 ranch 3 2.5 2441 1 920:540/512/436 9354 Sauls Rd. 197000 1 split 3 1 1245 36 920:524/388/348 2414 Van Dyke 85000 7 twnhouse 2 1.5 1280 4 920:584/592/588 409 Galashiels 60000 4 ranch 3 3 2400 2 920:420/424/428 8122 Maude Steward Rd. 129900 2 duplex 2 2.5 1184 4 920:364/604/368 112 Lake Hollow 67900 6 duplex 3 1 1569 73 350:324/328/336 108 South Elm St. 100000 2 twnhouse 2 1.5 1040 9 920:414/604/316 216 Concannon Ct. 59900 4 condo 3 2 1448 5 920:448/472/318 6000-102 Winterpoint 79900 2 twnhouse 3 2 1471 1 920:364/604/368 765 Crabtree Crossing 184000 4 twostory 3 2.5 1940 4 920:328/312/316 1641 Pricewood Lane 195000 5 split 2 1 960 2 680:308/304/332 Rt.5 Yarbororugh Rd. 78900 8 twnhouse 2 2 1167 5 320:364/366/312 5001 Pine Cone 78500 2 condo 2 2 1246 4 920:364/604/316 721 Springfork 76900 1 twnhouse 2 1 980 4 920:304/360/552 1203 Berley Ct 72400 8 twostory 4 2.5 3446 0 320:313/316/356 Lot 10 Red Coach Rd. 225000 8 split 3 1.5 1441 28 320:315/316/356 5617 Laurel Crest Dr. 86900 5 twostory 3 2.5 1900 4 680:308/316/332 1532 St. Mary's Rd. 118500 8 split 3 2 1976 10 320:348/316/356 110 Skylark Way 123500 8 twnhouse 2 2 1276 6 321:360/304/356 8 Stonevillage 71000 5 split 3 2 1533 5 680:308/316/322 603 Greentree Dr. 117800 2 twostory 4 2.5 2584 0 920:364/640/368 114 Grey Horse Dr. 189900 8 twostory 4 2.5 2608 0 320:362/366/312 2103 Carriage Way 189900 2 twnhouse 3 2.5 2080 4 920:530/400/318 108 Chattle Close 179900 5 twostory 3 2.5 2863 7 680:308/316/332 5521 Horseshoe Circle 199200 8 split 2 2.5 2900 38 320:315/316/356 2617 Snow Hill Rd 425000 3 twostory 4 2.5 3926 5 320:362/366/312 49 Birn Ham Lane 360000 4 split 3 1 1010 28 920:432/404/436 4341 Rock Quarry 60000 1 split 3 2 1662 12 920:488/360/552 6324 Lakeland, Lake Park 100000 2 split 3 2 2004 0 920:568/400/318 101 Meadowglade Ln. 179950 2 twostory 3 2.5 1650 0 920:364/608/368 100 Cumberland Green 143000 1 twostory 3 2.5 2416 6 920:568/356/318 6008 Brass Lantern Ct. 144500 4 ranch 3 2.5 2441 1 920:540/512/436 9356 Sauls Rd. 197000 1 twostory 5 3.5 4850 3 920:540/512/436 9317 Sauls Rd. 339950 4 split 3 1.5 1225 18 920:328/312/316 6424 Old Jenks Rd. 81900 ; proc format library=reports; value $zonefmt '1'='North Ridge' '2'='Inside Beltline' '3'='Southside' '4'='East Lake' '5'='Westend' '6'='Mountain Brook' '7'='Ensley' '8'='Roebuck'; run; proc report data=reports.housing nowindows headline headskip ls=100 ps=45; where price between 100000 and 250000; column zone type address bedr bath sqfeet age price; define zone / order format=$zonefmt15. width=15 'Zone'; define type / order format=$8.'Type'; define address / format=$25. width=25 'Address'; define price / format=dollar10. width=10 'Price'; define bedr / format=2. width=7 'Bedroom'; define bath / format=3.1 width=4 'Bath'; define sqfeet / format=comma6. width=6 'Square/Feet'; define age / format=3. 'Age'; break after zone / skip; title 'Listing of Local Residential Properties'; title2 'Price Range $100,000 to $200,000'; title3 'Listed by Zone'; footnote "Listing Produced on &sysdate"; run; /* This code is shown in Example 2 on page 10. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. */ /* The SAS data set REPORTS.HOUSING and the format $ZONEFMT. were */ /* created earlier in Example 2 in the code shown on page 8. */ options nodate pageno=1 linesize=100 pagesize=45 fmtsearch=(reports); libname reports 'SAS-data-library'; data reports.housing; input zone $1. +1 type : $8. bedr bath sqfeet age schools : $15. / address & $25. price; cards; 4 twostory 4 2.5 2538 6 920:340/400/368 211 Whitehall Way 154900 1 twostory 4 2.5 2700 7 920:470/360/552 1800 Bridgeport 169900 3 twnhouse 2 2 1595 6 320:332/366/312 154 Montrose 102000 1 twostory 3 2.5 2750 0 920:628/388/348 4000 Skipjack Ct. 214900 4 split 3 2 1306 0 920:576/512/436 5933 South Downs Dr. 95400 2 twostory 3 3.5 2590 0 920:364/608/368 727 Crabtree Crossing 292400 5 split 3 1 1959 31 680:308/316/332 627 Riverside Dr. 58900 2 twnhouse 3 2.5 1374 15 920:304/604/368 907 Lexington Ct. 65500 4 condo 2 2 1275 5 920:448/472/318 6010-102 Winterpoint 70000 4 ranch 3 2 1526 6 920:476/424/428 6509 Orchard Knoll 107900 1 split 3 1.5 1329 23 920:396/360/552 500 E. Millbrook Rd. 82900 1 condo 3 2.5 1300 5 920:448/472/318 6010-101 Winterpoint 68900 8 twnhouse 2 2 1120 4 320:364/366/312 521 Woodwinds 84600 2 condo 2 2 1066 1 920:520/604/368 1324 Killiam Ct. 74900 4 split 4 2.5 2600 10 920:476/424/428 7141 Eastridge 198000 2 twnhouse 2 1.5 1150 15 920:304/400/368 1239 Donaldson Ct. 49900 4 ranch 3 2.5 2441 1 920:540/512/436 9354 Sauls Rd. 197000 1 split 3 1 1245 36 920:524/388/348 2414 Van Dyke 85000 7 twnhouse 2 1.5 1280 4 920:584/592/588 409 Galashiels 60000 4 ranch 3 3 2400 2 920:420/424/428 8122 Maude Steward Rd. 129900 2 duplex 2 2.5 1184 4 920:364/604/368 112 Lake Hollow 67900 6 duplex 3 1 1569 73 350:324/328/336 108 South Elm St. 100000 2 twnhouse 2 1.5 1040 9 920:414/604/316 216 Concannon Ct. 59900 4 condo 3 2 1448 5 920:448/472/318 6000-102 Winterpoint 79900 2 twnhouse 3 2 1471 1 920:364/604/368 765 Crabtree Crossing 184000 4 twostory 3 2.5 1940 4 920:328/312/316 1641 Pricewood Lane 195000 5 split 2 1 960 2 680:308/304/332 Rt.5 Yarbororugh Rd. 78900 8 twnhouse 2 2 1167 5 320:364/366/312 5001 Pine Cone 78500 2 condo 2 2 1246 4 920:364/604/316 721 Springfork 76900 1 twnhouse 2 1 980 4 920:304/360/552 1203 Berley Ct 72400 8 twostory 4 2.5 3446 0 320:313/316/356 Lot 10 Red Coach Rd. 225000 8 split 3 1.5 1441 28 320:315/316/356 5617 Laurel Crest Dr. 86900 5 twostory 3 2.5 1900 4 680:308/316/332 1532 St. Mary's Rd. 118500 8 split 3 2 1976 10 320:348/316/356 110 Skylark Way 123500 8 twnhouse 2 2 1276 6 321:360/304/356 8 Stonevillage 71000 5 split 3 2 1533 5 680:308/316/322 603 Greentree Dr. 117800 2 twostory 4 2.5 2584 0 920:364/640/368 114 Grey Horse Dr. 189900 8 twostory 4 2.5 2608 0 320:362/366/312 2103 Carriage Way 189900 2 twnhouse 3 2.5 2080 4 920:530/400/318 108 Chattle Close 179900 5 twostory 3 2.5 2863 7 680:308/316/332 5521 Horseshoe Circle 199200 8 split 2 2.5 2900 38 320:315/316/356 2617 Snow Hill Rd 425000 3 twostory 4 2.5 3926 5 320:362/366/312 49 Birn Ham Lane 360000 4 split 3 1 1010 28 920:432/404/436 4341 Rock Quarry 60000 1 split 3 2 1662 12 920:488/360/552 6324 Lakeland, Lake Park 100000 2 split 3 2 2004 0 920:568/400/318 101 Meadowglade Ln. 179950 2 twostory 3 2.5 1650 0 920:364/608/368 100 Cumberland Green 143000 1 twostory 3 2.5 2416 6 920:568/356/318 6008 Brass Lantern Ct. 144500 4 ranch 3 2.5 2441 1 920:540/512/436 9356 Sauls Rd. 197000 1 twostory 5 3.5 4850 3 920:540/512/436 9317 Sauls Rd. 339950 4 split 3 1.5 1225 18 920:328/312/316 6424 Old Jenks Rd. 81900 ; proc format library=reports; value $zonefmt '1'='North Ridge' '2'='Inside Beltline' '3'='Southside' '4'='East Lake' '5'='Westend' '6'='Mountain Brook' '7'='Ensley' '8'='Roebuck'; run; proc sort data=reports.housing out=reports.ordered; by zone type; run; proc print data=reports.ordered uniform split='/'; where price between 100000 and 250000; by zone; id zone; var type address bedr bath sqfeet age price; format sqfeet comma6. price dollar10. zone $zonefmt15.; label zone='Zone/---------------' type='Type/--------' address='Address/-------------------------' bedr='Bedroom/-------' bath='Bath/----' sqfeet='Square/Feet/------' age='Age/---' price='Price/----------'; title 'Listing of Local Residential Properties'; title2 'Price Range $100,000 to $250,000'; title3 'Listed by Zone'; footnote "Listing Produced on &sysdate"; run; /* This code is shown in Example 3 on page 14. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. */ options nodate pageno=1 fmtsearch=(reports); libname reports 'SAS-data-library'; data reports.daily1; input sector $ manager $ paper mt_dairy cans produce; cards; se 1 50 100 120 80 se 2 40 300 220 70 nw 3 60 600 420 30 nw 4 45 250 230 73 nw 9 45 205 420 76 sw 5 53 130 120 50 sw 6 40 350 225 80 ne 7 90 190 420 86 ne 8 200 300 420 125 ; proc format library=reports; value $sctrfmt 'se' = 'Southeast' 'ne' = 'Northeast' 'nw' = 'Northwest' 'sw' = 'Southwest'; value $mgrfmt '1' = 'Smith' '2' = 'Jones' '3' = 'Reveiz' '4' = 'Brown' '5' = 'Taylor' '6' = 'Adams' '7' = 'Alomar' '8' = 'Andrews' '9' = 'Pelfrey'; run; proc report data=reports.daily1 nowd headline headskip split='*' ls=120 ps=40; column sector manager ('_Department_* ' cans paper) npamount ('_Department_* ' mt_dairy produce) pamount total; define sector / order format=$sctrfmt. width=9 'Sector' center; define manager / order format=$mgrfmt. width=8 'Manager'; define cans / analysis sum format=dollar10.2 'Canned'; define paper / analysis sum format=dollar10.2 'Paper'; define mt_dairy / analysis sum format=dollar10.2 'Meat/Dairy'; define produce / analysis sum format=dollar10.2 'Produce'; define npamount / computed format=dollar10.2 'Non*Perishable' center; define pamount / computed format=dollar10.2 'Perishable'; define total / computed format=dollar10.2 'Total'; compute npamount; npamount=cans.sum+paper.sum; endcomp; compute pamount; pamount=mt_dairy.sum+produce.sum; endcomp; compute total; total=npamount+pamount; endcomp; break after sector / summarize ol skip; rbreak after / summarize dol dul; title 'Grocery Mart'; title2 "Revenue for &sysdate"; run; /* This code is shown in Example 3 on page 18. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. */ /* The SAS data set REPORTS.DAILY and the formats $SCTRFMT. and */ /* $MGRFMT. were created earlier in Example 3 in the code shown */ /* on page 14. */ options nodate pageno=1 linesize=80 pagesize=60 fmtsearch=(reports); libname reports 'SAS-data-library'; proc sort data=reports.daily1 out=sorted; by sector manager; run; proc print data=sorted label; var manager cans paper mt_dairy produce; id sector; by sector; sum cans paper mt_dairy produce; label cans='Canned' paper='Paper' mt_dairy='Meat/Dairy' produce='Produce' sector='Sector' manager='Manager'; format cans paper mt_dairy produce dollar10.2 sector $sctrfmt. manager $mgrfmt.; title 'Grocery Mart'; title2 "Daily Revenue for &sysdate"; run; /* This code is shown in Example 4 on page 22. */ options nodate pageno=1; data daily; input sector $ manager $ dept $ amount; cards; se 1 np1 50 se 1 p1 100 se 1 np2 120 se 1 p2 80 se 2 np1 40 se 2 p1 300 se 2 np2 220 se 2 p2 70 nw 3 np1 60 nw 3 p1 600 nw 3 np2 420 nw 3 p2 30 nw 4 np1 45 nw 4 p1 250 nw 4 np2 230 nw 4 p2 73 nw 9 np1 45 nw 9 p1 205 nw 9 np2 420 nw 9 p2 76 sw 5 np1 53 sw 5 p1 130 sw 5 np2 120 sw 5 p2 50 sw 6 np1 40 sw 6 p1 350 sw 6 np2 225 sw 6 p2 80 ne 7 np1 90 ne 7 p1 190 ne 7 np2 420 ne 7 p2 86 ne 8 np1 200 ne 8 p1 300 ne 8 np2 420 ne 8 p2 125 ; proc format; value $sctrfmt 'se' = 'Southeast' 'ne' = 'Northeast' 'nw' = 'Northwest' 'sw' = 'Southwest'; value $mgrfmt '1' = 'Smith' '2' = 'Jones' '3' = 'Reveiz' '4' = 'Brown' '5' = 'Taylor' '6' = 'Adams' '7' = 'Alomar' '8' = 'Andrews' '9' = 'Pelfrey'; value $grocfmt 'np1' = 'Paper' 'np2' = 'Canned' 'p1' = 'Meat/Dairy' 'p2' = 'Produce'; run; proc report data=daily nowd headline headskip split='*' ls=120 ps=40; column sector manager amount,dept npamount pamount amount=total; define sector / group format=$sctrfmt. width=9 'Sector' center; define manager / group format=$mgrfmt. width=8 'Manager'; define dept / across '_Department_* ' format=$grocfmt. width=10 order=internal; define amount / analysis sum ' ' format=dollar10.2; define total / analysis sum 'Total' format=dollar10.2; define pamount / computed format=dollar10.2 width=10 'Perishable'; define npamount / computed format=dollar10.2 width=10 'Non*Perishable' center; compute npamount; npamount=_c3_+_c4_; endcomp; compute pamount; pamount=_c5_+_c6_; endcomp; break after sector / summarize ol skip; rbreak after / summarize dol dul; title 'Grocery Mart'; title2 "Revenue for &sysdate"; run; /* This code is shown in Example 5 on page 31. */ options nodate pageno=1 linesize=120 pagesize=48; data marathon; input year 4. +2 winner $22. +2 gender $1. +2 country $13. +2 time time7.; cards; 1957 John J. Kelley M United States 2:20:05 1958 Franjo Mihalic M Yugoslavia 2:25:54 1959 Eino Oksanen M Finland 2:22:42 1960 Paavo Kotila M Finland 2:20:54 1961 Eino Oksanen M Finland 2:23:39 1962 Eino Oksanen M Finland 2:23:48 1963 Aurele Vandendriessche M Belgium 2:18:58 1964 Aurele Vandendriessche M Belgium 2:19:59 1965 Morio Shigematsu M Japan 2:16:33 1966 Kenji Kimihara M Japan 2:17:11 1967 David McKenzie M New Zealand 2:15:45 1968 Amby Burfoot M United States 2:22:17 1969 Yoshiaki Unetani M Japan 2:13:49 1970 Ron Hill M England 2:10:30 1971 Alvaro Mejia M Colombia 2:18:45 1972 Olavi Suomalainen M Finland 2:15:39 1972 Nina Kuscsik W United States 3:10:36 1973 Jon Anderson M United States 2:16:03 1973 Jacqueline A. Hansen W United States 3:05:59 1974 Neil Cusack M Ireland 2:13:39 1974 Miki Gorman W United States 2:47:11 1975 Bill Rodgers M United States 2:09:55 1975 Liane Winter W West Germany 2:42:24 1976 Jack Fultz M United States 2:20:19 1976 Kim Merritt W United States 2:47:10 1977 Jerome Drayton M Canada 2:14:46 1977 Miki Gorman W United States 2:48:33 1978 Bill Rodgers M United States 2:10:13 1978 Gayle Barron W United States 2:44:52 1979 Bill Rodgers M United States 2:09:27 1979 Joan Benoit W United States 2:35:15 1980 Bill Rodgers M United States 2:12:11 1980 Jacqueline Gareau W Canada 2:34:28 1981 Toshihiko Seko M Japan 2:09:26 1981 Allison Roe W New Zealand 2:26:46 1982 Alberto Salazar M United States 2:08:52 1982 Charlotte Teske W West Germany 2:29:33 1983 Gregory A. Meyer M United States 2:09:00 1983 Joan Benoit W United States 2:22:43 1984 Geoff Smith M England 2:10:34 1984 Lorraine Moller W New Zealand 2:29:28 1985 Geoff Smith M England 2:14:05 1985 Lisa Larsen Weidenbach W United States 2:34:06 1986 Rob de Castella M Australia 2:07:51 1986 Ingrid Kristiansen W Norway 2:24:55 1987 Toshihiko Seko M Japan 2:11:50 1987 Rosa Mota W Portugal 2:25:21 1988 Ibrahim Hussein M Kenya 2:08:43 1988 Rosa Mota W Portugal 2:24:30 1989 Abebe Mekonnen M Ethiopia 2:09:06 1989 Ingrid Kristiansen W Norway 2:24:33 1990 Gelindo Bordin M Italy 2:08:19 1990 Rosa Mota W Portugal 2:25:24 1991 Ibrahim Hussein M Kenya 2:11:06 1991 Wanda Panfil W Poland 2:24:18 1992 Ibrahim Hussein M Kenya 2:08:14 1992 Olga Markova W Russia 2:23:43 ; proc sort data=marathon; by gender; run; proc rank data=marathon out=ordered ties=low; by gender; var time; ranks order; run; proc rank data=marathon out=grouped groups=4 descending ties=high; by gender; var time; ranks quartile; run; data combine; merge ordered grouped; run; proc format; value $div 'M'="Men's Division" 'W'="Women's Division"; value quarter 3='Top' 2='High Mid' 1='Low Mid' 0='Bottom'; run; options nobyline; proc print data=combine n; var year winner country time order quartile; by gender; format gender $div. time time7. quartile quarter.; title1 'Official Results of Boston Marathon 1957-92'; title2 'With Winning Times Ranked from Fastest(1) to Slowest(N)'; title4 '#byval(gender)'; run; /* This code is shown in Example 6 on page 38. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. options ls=80 ps=60 nodate pageno=1 fmtsearch=(reports); libname reports 'SAS-data-library'; data reports.phondata; input hour primtime time8. status $10. @@; cards; 12 0:04:20 PRIM/RES 12 0:13:29 RESOLVED 10 0:08:06 PRIM/RES 13 0:06:06 PRIM/RES 11 0:04:05 PRIM/RES 14 0:02:23 PRIM/RES 16 0:01:40 NO ANSWER 15 0:00:30 PRIM/RES 9 0:08:51 LMOM 13 0:10:53 PRIM/RES 12 0:03:30 PRIM/RES 11 0:02:55 RESOLVED 13 0:03:52 PRIM/RES 11 0:05:45 PRIM/RES 10 0:01:59 PRIM/RES 14 0:24:38 PINK SLIP 14 0:01:43 PRIM/RES 13 0:01:20 PRIM/RES 14 0:04:15 PRIM/RES 12 0:10:35 USER CALLD 14 0:07:23 PRIM/RES 15 0:09:32 ACCEPTED 16 0:21:29 PRIM/RES 14 0:07:15 PRIM/RES 16 0:01:42 DISTRIB 13 0:04:14 PRIM/RES 15 0:14:01 RESOLVED 11 0:08:51 PRIM/RES 13 0:04:37 PRIM/RES 12 0:10:20 PRIM/RES 13 0:03:54 PRIM/RES 11 0:10:19 PRIM/ACC 15 0:04:19 PRIM/RES 9 0:01:14 PRIM/RES 11 0:12:47 PRIM/RES 9 0:07:24 NO ANSWER 14 0:02:38 PRIM/RES 10 0:07:43 PRIM/ACC 10 0:02:36 PRIM/RES 13 0:17:28 PRIM/ACC 10 0:00:04 PRIM/RES 14 0:13:39 PRIM/RES 16 0:13:06 PRIM/RES 15 0:09:36 PRIM/RES 15 0:07:50 PRIM/RES 16 0:02:42 PRIM/RES 11 0:09:52 PRIM/RES 11 0:07:43 PRIM/RES 15 0:07:55 PRIM/RES 15 0:15:54 PRIM/RES 16 0:11:36 PRIM/RES 15 0:04:13 PRIM/RES 11 0:14:44 PRIM/RES 15 0:05:00 PRIM/RES 11 0:02:46 PRIM/RES 14 0:04:44 RESOLVED 16 0:01:05 PRIM/RES 10 0:01:56 PRIM/RES 14 0:15:37 CALLD USER 10 0:01:56 PRIM/RES 15 0:08:44 PRIM/ACC 12 0:12:14 PRIM/RES 11 0:02:41 PRIM/RES 14 0:02:31 PRIM/RES 11 0:02:41 PRIM/RES 9 0:08:12 LMWA 14 0:07:50 PRIM/RES 13 0:08:33 CALL 9 0:03:45 PRIM/RES 10 0:08:06 RESOLVED 10 0:02:57 PRIM/RES 13 0:05:19 CALLD USER 15 0:06:06 PRIM/RES 16 0:04:56 PRIM/RES 14 0:13:46 RESOLVED 10 0:02:12 PRIM/RES 16 0:03:37 PRIM/ACC 10 0:08:28 PRIM/RES 14 0:19:48 ACCEPTED 12 0:00:11 PRIM/RES 11 0:02:28 PRIM/RES 16 0:22:08 PRIM/RES 9 0:08:29 ACCEPTED 15 0:03:23 PRIM/RES 12 0:02:09 PRIM/RES 12 0:04:33 PRIM/RES 12 0:14:34 PRIM/RES 14 0:01:55 PRIM/RES 15 0:01:31 PRIM/RES 13 0:05:43 PRIM/RES 14 0:00:56 RESPONSE 10 0:05:15 PRIM/RES 10 0:04:52 PRIM/RES 14 0:05:05 PRIM/RES 10 0:04:26 PRIM/RES 13 0:10:48 PRIM/RES 10 0:13:20 ACCEPTED 14 0:04:18 PRIM/RES 14 0:01:14 PRIM/RES 13 0:15:45 LMOM 15 0:04:07 PRIM/RES 13 0:05:23 PRIM/RES 15 0:04:02 RESOLVED 16 0:07:23 PRIM/RES 11 0:00:58 PRIM/RES 11 0:02:45 PRIM/RES 12 0:05:52 PRIM/RES 13 0:02:26 PRIM/RES 10 0:05:51 PRIM/RES 9 0:07:20 RESPONSE 14 1:26:50 PRIM/RES 14 0:04:27 PRIM/RES 14 0:13:44 USER CALLD 9 0:08:13 PRIM/RES 10 0:38:28 PRIM/RES 12 0:06:12 PINK SLIP 9 0:03:53 PRIM/RES 10 0:02:54 PRIM/RES 14 0:03:34 ACCEPTED 14 0:02:36 PRIM/RES 9 0:20:24 TELL USER 14 0:05:53 PRIM/RES 11 0:16:18 PRIM/ACC 14 0:13:10 PRIM/RES 14 0:02:03 PRIM/RES 15 0:05:02 PRIM/RES 14 0:04:12 ACCEPTED 10 0:04:35 PRIM/RES 14 0:03:46 PRIM/RES 13 0:00:21 PRIM/RES 11 0:01:27 RESOLVED 9 0:02:29 PRIM/RES 15 0:05:06 RESPONSE 16 0:07:25 PRIM/RES 16 0:14:25 RESOLVED 15 0:07:30 PRIM/RES 10 0:10:12 RESOLVED 10 0:02:49 PRIM/RES 16 0:05:35 PRIM/ACC 9 0:00:12 PRIM/RES 13 0:05:24 PRIM/RES 11 0:12:09 PINK SLIP 9 0:06:14 PRIM/RES 14 0:07:03 PRIM/RES 11 0:04:55 ACCEPTED 14 0:13:50 PRIM/RES 16 0:15:53 PRIM/ACC 16 0:03:19 PRIM/RES 12 0:08:41 PRIM/RES 11 0:04:25 PRIM/RES 14 0:03:46 PRIM/RES 16 0:07:45 CALLD USER 15 0:18:52 PRIM/RES 16 0:01:47 RESOLVED 16 0:05:21 PRIM/RES 16 0:10:24 PRIM/RES 10 0:03:53 PRIM/RES 11 0:11:21 PRIM/RES 15 0:02:32 PRIM/RES 16 0:01:59 PRIM/RES 12 0:10:38 CALLD USER 16 0:03:26 PRIM/RES 16 0:03:29 PRIM/ACC 15 0:05:14 PRIM/RES 15 0:06:45 PRIMARY 15 0:00:19 PRIM/RES 14 0:12:57 PRIM/RES 10 0:13:36 PRIM/RES 9 0:06:56 CALLD USER 13 0:01:45 PRIM/RES 11 0:15:17 CALLD USER 10 0:03:45 PRIM/RES 11 0:14:36 PINK SLIP 15 0:08:07 PRIM/RES 15 0:11:05 PRIM/RES 13 0:05:26 PRIM/RES 13 0:06:48 PRIM/ACC 15 0:01:35 PRIM/RES 11 0:09:56 PRIM/RES 11 0:20:13 PRIM/RES 15 0:04:39 PRIM/RES 15 0:06:22 PRIM/RES 15 0:06:49 PRIM/RES 14 0:08:12 HOLD-2/2 14 0:02:40 PRIM/RES 10 0:05:11 RESOLVED 14 0:09:09 PRIM/RES 13 0:02:44 PRIM/RES 10 0:08:10 RESOLVED 14 0:32:54 PRIM/RES 9 0:01:54 PRIM/RES 13 0:05:01 PRIM/RES 10 0:04:10 PRIM/RES 15 0:14:46 ACCEPTED 9 0:03:44 PRIM/RES 14 0:08:13 RESOLVED 9 0:09:18 PRIM/RES 13 0:03:24 SENT INFO 10 0:03:46 PRIM/RES 10 0:03:41 PRIM/RES 11 0:17:24 SENT INFO 14 0:04:22 PRIM/RES 16 0:05:16 PRIM/ACC 9 0:04:34 PRIM/RES 13 0:12:17 ACCEPTED 9 0:01:39 PRIM/RES 11 0:01:00 PRIM/RES 10 0:11:44 PRIM/RES 13 0:00:23 ACCEPTED 9 0:01:29 PRIM/RES 11 0:18:14 PRIM/ACC 12 0:14:32 PRIM/RES 12 0:16:05 PRIM/RES 16 0:03:30 PRIM/RES 14 0:00:55 PRIM/RES 12 0:08:10 PRIM/RES 13 0:16:21 CALLD USER 10 0:03:59 PRIM/RES 15 0:04:40 PRIM/RES 14 0:02:33 PRIM/RES 13 0:05:07 CALLD USER 15 0:08:53 PRIM/RES 10 0:03:21 RESOLVED 9 0:09:18 PRIM/RES 9 0:11:51 PRIM/RES 16 0:17:37 PRIM/RES 16 0:16:38 PRIM/RES 12 0:12:19 RESOLVED 14 0:07:45 PRIM/RES 13 0:13:14 PRIM/ACC 9 0:02:11 PRIM/RES 10 0:11:07 RESOLVED 10 0:03:33 PRIM/RES 16 0:05:21 PRIM/RES 15 0:13:23 PRIM/RES 12 0:23:04 ACCEPTED 10 0:03:57 PRIM/RES 9 0:04:32 PRIM/RES 16 0:00:22 PRIM/RES 15 0:26:49 HOLD-FR-4 16 0:05:31 PRIM/RES 9 0:07:55 ACCEPTED 13 0:09:00 PRIM/RES 14 0:11:26 PRIM/RES 13 0:04:27 PRIM/RES 10 0:05:16 CALLD USER 9 0:09:07 PRIM/RES 14 0:11:21 RESOLVED 14 0:07:25 PRIM/RES 9 0:10:07 PRIM/RES 10 0:02:10 PRIM/RES 12 0:32:13 PRIM/RES 15 0:09:51 PRIM/RES 15 0:03:53 PRIM/RES 15 0:34:44 PRIM/RES 9 0:07:37 PRIM/RES 11 0:05:06 PRIM/RES 12 0:02:39 PRIM/RES 12 0:29:14 WORK 11 0:02:35 PRIM/RES 15 0:12:38 HOLD-0207 14 0:02:27 PRIM/RES 15 0:06:36 PRIM/RES 10 0:25:47 PRIM/RES 11 0:05:33 PRIM/RES 10 0:20:42 ACCEPTED 13 0:02:56 PRIM/RES 11 0:04:04 RESOLVED 16 0:07:56 PRIM/RES 12 0:08:20 PRIM/RES 15 0:22:29 RESOLVED 10 0:03:35 PRIM/RES 15 0:07:05 PRIM/RES 14 0:03:54 PRIM/RES 9 0:03:57 PRIM/RES 11 0:05:44 PRIM/ACC 13 0:18:00 PRIM/RES 14 0:04:23 PRIM/RES 9 0:30:26 PRIM/RES 10 0:06:31 PRIM/RES 15 0:02:03 PRIM/RES 11 0:10:34 RESPONSE 14 0:07:18 PRIM/RES 11 0:12:26 PRIM/RES 13 0:03:02 PRIM/RES 13 0:03:41 LMOM 15 0:09:59 PRIM/RES 16 0:05:47 PRIMARY 16 0:05:53 PRIM/RES 16 0:00:20 PRIM/RES 13 0:02:52 PRIM/RES 15 0:02:00 PINK SLIP 16 0:01:45 PRIM/RES 16 0:11:58 PRIM/RES 15 0:02:06 PRIM/RES 16 0:05:22 CALLD USER 15 0:07:21 PRIM/RES 16 0:05:26 PRIM/RES 13 0:02:18 PRIM/ACC 15 0:01:54 PRIM/RES 16 0:12:50 PRIMARY 10 0:08:11 PRIM/RES 15 0:03:03 PRIM/RES 14 0:11:35 PRIM/RES 11 0:06:49 LMOM-1/31 14 0:02:37 PRIM/RES 15 0:08:38 PRIM/RES 15 0:16:16 RESOLVED 12 0:18:09 PRIM/RES 15 0:03:18 PINK SLIP 16 0:02:20 PRIM/RES 9 0:09:10 LMOM-2/2 16 0:06:36 PRIM/RES 9 0:05:30 PRIM/RES 16 0:03:29 PRIM/RES 11 0:04:12 PRIM/RES 10 0:00:23 PRIM/RES 16 0:27:56 PRIM/RES 15 0:02:16 ACCEPTED 16 0:09:39 PRIM/RES 15 0:10:04 PRIMARY 14 0:22:48 PRIM/RES 15 0:05:33 RESOLVED 15 0:04:48 PRIM/RES 11 0:02:12 PRIM/RES 10 0:09:08 RESOLVED 14 0:02:08 PRIM/RES 13 0:00:04 ACCEPTED 15 0:05:22 PRIM/RES 11 0:11:33 PRIM/RES 11 0:24:08 HOLD-2/2 12 0:15:10 PRIM/RES 10 0:01:49 RESOLVED 10 0:01:28 PRIM/RES 9 0:00:00 ACCEPTED 11 0:03:23 PRIM/RES 11 0:05:07 PRIM/RES 15 0:16:45 PRIM/RES 11 0:16:01 PRIM/RES 11 0:02:22 PRIM/RES 13 0:04:28 PRIM/RES 12 0:26:20 HOLD-2/7 12 0:06:00 PRIM/RES 14 0:02:45 PRIM/RES 11 0:14:02 PRIM/RES 14 0:02:49 RESOLVED 16 0:01:45 PRIM/RES 15 0:03:33 PRIM/RES 16 0:13:29 PRIM/RES 9 0:05:19 PRIM/RES 15 0:05:45 PRIM/RES 11 0:03:07 PRIM/RES 12 0:05:41 PRIM/RES 15 0:01:51 PRIM/RES 11 0:32:06 ACCEPTED 10 0:04:31 PRIM/RES 10 0:07:10 CALLD USER 13 0:12:24 PRIM/RES 11 0:29:40 PINK SLIP 9 0:01:37 PRIM/RES 10 0:30:31 PRIM/RES 14 0:02:45 PRIM/RES 10 0:07:46 LMOM 10 0:07:41 PRIM/RES 15 0:06:21 RESOLVED 14 0:03:04 PRIM/RES 11 0:01:40 RESOLVED 12 0:00:22 PRIM/RES 12 0:07:45 PRIM/RES 15 0:06:49 ACCEPTED 16 0:05:55 PRIM/RES 11 0:15:36 PRIM/RES 14 0:02:09 ACCEPTED 16 0:01:45 PRIM/RES 12 0:08:49 PRIM/RES 16 0:07:15 PRIM/RES 9 0:09:46 PRIM/RES 12 0:00:42 PRIM/RES 9 0:01:27 PRIM/RES 12 0:19:26 HOLD-02/04 13 0:05:12 PRIM/RES 10 0:01:56 PRIM/RES 14 0:14:31 PRIM/RES 13 0:04:44 PRIM/RES 11 0:05:44 PRIM/ACC 14 0:10:19 PRIM/RES 10 0:21:16 RESOLVED 13 0:00:43 PRIM/RES 16 0:04:25 PRIM/RES 11 0:10:29 RESOLVED 12 0:00:32 PRIM/RES 16 0:12:41 PRIM/RES 14 0:14:46 RESOLVED 9 0:02:04 PRIM/RES 10 0:00:18 PRIM/ACC 13 0:09:01 PRIM/RES 13 0:02:16 PRIM/RES 14 0:58:45 RESPONSE 15 0:01:52 PRIM/RES 10 0:08:59 RESOLVED 9 0:09:31 PRIM/RES 13 0:27:23 CALLD USER 10 0:03:12 PRIM/RES 15 0:00:29 PRIM/RES 13 0:03:46 PRIM/RES 11 0:02:54 PRIM/RES 9 0:09:09 TELL USER 13 0:09:13 PRIM/RES 9 0:00:00 EMITS SENT 11 0:05:28 PRIM/RES 10 0:06:36 CALLD USER 10 0:03:39 PRIM/RES 12 0:05:12 PRIM/RES 12 0:26:31 CALL 9 0:03:44 PRIM/RES 9 0:02:49 PRIM/RES 10 0:02:44 RESOLVED 10 0:30:08 PRIM/RES 16 0:06:32 PRIM/RES 13 0:14:33 PRIM/RES 9 0:12:21 PRIM/RES 13 0:10:28 CALL 9 0:11:28 PRIM/RES 9 0:02:15 PRIM/RES 12 0:05:40 DISTRIB 16 0:08:43 PRIM/RES 15 0:02:16 PRIM/RES 12 0:03:34 PRIM/RES 10 0:06:03 PRIM/RES 12 0:00:00 PRIM/EMITS 9 0:03:02 PRIM/RES 15 0:15:50 SENT INFO 12 0:07:16 PRIM/RES 14 0:01:38 PRIM/RES 15 0:01:07 PRIM/RES 11 0:01:46 RESOLVED 16 0:02:06 PRIM/RES 9 0:14:05 ACCEPTED 10 0:11:28 PRIM/RES 10 0:10:25 PINK SLIP 10 0:06:54 PRIM/RES 9 0:10:02 ACCEPTED 13 0:00:03 PRIM/RES 11 0:25:08 HOLD-02/04 9 0:06:39 PRIM/RES 11 0:04:24 CALL 14 0:04:03 PRIM/RES 16 0:04:35 PRIMARY 9 0:03:50 PRIM/RES 12 0:11:47 PRIM/RES 11 0:03:43 PRIM/RES 10 0:22:03 RESOLVED 10 0:07:08 PRIM/RES 16 0:08:00 PRIM/RES 16 0:07:10 PRIM/RES 9 0:06:16 PRIM/RES 12 0:00:00 PRIM/EMITS 9 0:01:17 PRIM/RES 11 0:20:38 ACCEPTED 10 0:17:48 PRIM/RES 10 0:18:02 PRIM/RES 9 0:09:47 HOLD 15 0:13:17 PRIM/RES 11 0:02:13 PRIM/RES 14 0:01:30 PRIM/RES 16 0:07:47 ACCEPTED 16 0:10:33 PRIM/RES 14 0:02:13 PRIM/RES 13 0:02:15 PRIM/RES 11 0:09:19 ACCEPTED 9 0:05:09 PRIM/RES 11 0:03:21 PRIM/RES 9 0:02:30 PRIM/RES 15 0:05:08 PRIM/RES 11 0:07:55 DISTRIB 14 0:03:48 PRIM/RES 14 0:06:59 PRIM/RES 12 0:01:24 LMOM 15 0:08:45 PRIM/RES 15 0:05:30 RESOLVED 11 0:08:01 PRIM/RES 11 0:15:40 PRIM/RES 11 0:10:23 PRIM/RES 15 0:04:59 PRIM/RES 11 0:34:08 RESOLVED 11 0:13:42 PRIM/RES 9 0:06:36 RESOLVED 13 0:03:06 PRIM/RES 12 0:00:00 RESPONSE 16 0:16:10 PRIM/RES 15 0:08:59 PRIM/RES 12 0:05:26 PRIM/RES 14 0:09:37 SENT INFO 14 0:05:40 PRIM/RES 9 0:09:54 CALLD USER 15 0:01:32 PRIM/RES 13 0:02:00 PRIM/RES 12 0:14:06 PRIM/RES 13 0:05:30 ACCEPTED 13 0:24:27 PRIM/RES 15 0:06:26 RESOLVED 15 0:26:58 PRIM/RES 12 0:06:33 PRIM/RES 12 0:22:03 PRIM/RES 16 0:00:05 PRIM/RES 13 0:03:35 PRIM/RES 16 0:29:27 PRIM/RES 11 0:12:33 PRIM/RES 13 0:06:02 LMOM 15 0:08:11 PRIM/RES 13 0:09:57 PRIM/RES 12 0:13:34 PRIM/RES 10 0:04:25 RESOLVED 14 0:09:45 PRIM/RES 11 0:01:03 PRIM/RES 11 0:04:50 PRIM/RES 14 0:02:59 PRIM/RES 12 0:01:22 RESOLVED 12 0:01:53 PRIM/RES 16 0:08:00 PRIMARY 16 0:06:46 PRIM/RES 10 0:02:45 PRIM/RES 10 0:00:19 ACCEPTED 16 0:02:15 PRIM/RES 14 0:20:02 CALL 16 0:07:27 PRIM/RES 12 0:04:04 PRIM/RES 16 0:08:35 PRIM/ACC 15 0:05:01 PRIM/RES 15 0:04:44 PINK SLIP 9 0:06:55 PRIM/RES 14 0:02:06 ACCEPTED 16 0:05:46 PRIM/RES 13 0:02:06 PRIM/RES 14 0:04:27 PRIM/RES 9 0:04:49 PRIM/RES 14 0:03:10 PRIM/RES 10 0:01:59 PRIM/RES 14 0:00:44 HOLD-2/04 14 0:07:38 PRIM/RES 10 0:53:32 CALLD USER 11 0:17:04 PRIM/RES 13 0:05:50 PRIM/RES 12 0:00:20 RESOLVED 9 0:01:59 PRIM/RES 16 0:05:55 PRIM/RES 15 0:01:32 RESPONSE 16 0:00:07 PRIM/RES 16 0:06:00 PRIMARY 15 0:05:18 PRIM/RES 10 0:00:34 PRIM/RES 9 0:05:28 PRIM/ACC 10 0:00:08 PRIM/RES 12 0:02:29 PRIM/RES 9 0:02:12 RESOLVED 11 0:04:26 PRIM/RES 12 0:08:40 PINK SLIP 14 0:44:59 PRIM/RES 9 0:03:47 ACCEPTED 10 0:00:06 PRIM/RES 15 0:06:41 PRIM/RES 14 0:03:22 SENT INFO 14 0:07:36 PRIM/RES 14 0:05:16 PRIM/RES 16 0:04:27 PRIM/RES 14 0:08:48 PRIMARY 14 0:03:43 PRIM/RES 9 0:00:00 ACCEPTED 15 0:01:54 PRIM/RES 14 0:02:00 RESPONSE 16 0:04:46 PRIM/RES 12 0:11:15 WORK 16 0:07:41 PRIM/RES 16 0:03:18 PRIM/ACC 13 0:13:26 PRIM/RES 11 0:05:27 PRIM/RES 15 0:00:42 HEADER CHG 14 0:01:01 PRIM/RES 16 0:05:51 PRIM/RES 14 0:04:14 PRIM/RES 11 0:03:36 PRIM/RES ; proc format library=reports; value $statfmt 'PRIM/RES'='Resolved on Initial Call' other='Tracked to Specialist' ' '=' '; value hourfmt 9='9:00' 10='10:00' 11='11:00' 12='12:00' 13='1:00' 14='2:00' 15='3:00' 16='4:00' .='.'; run; proc summary data=reports.phondata nway; class hour status; var primtime; format status $statfmt. hour hourfmt.; output out=phonstat mean=meantime; run; proc print data=phonstat label; by hour; id hour; var status _freq_ meantime; sum _freq_; format meantime time8.; label hour='Hour' status='Status of Problems' _freq_='Number of Calls' meantime='Average Length of Calls'; title1 'Number and Average Length of Calls'; title2 'Received by Technical Support on 31JAN94'; run; /* This code is shown in Example 6 on page 40. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. /* The SAS data set REPORTS.PHONDATA and the formats $ STATFMT. and */ /* $HOURFMT. were created earlier in Example 6 in the code shown */ /* on page 38. */ options ls=80 ps=60 nodate pageno=1 fmtsearch=(reports); libname reports 'SAS-data-library'; proc summary data=reports.phondata; class hour status; var primtime; format status $statfmt. hour hourfmt.; output out=phonstat mean=meantime; run; proc print data=phonstat noobs; format meantime time8.; title1 'The Output Data Set without Using NWAY'; run; /* This code is shown in Example 6 on page 41. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. /* The SAS data set REPORTS.PHONDATA and the formats $ STATFMT. and */ /* $HOURFMT. were created earlier in Example 6 in the code shown */ /* on page 38. */ options nodate nonumber linesize=80 pagesize=60 fmtsearch=(reports); libname reports 'SAS-data-library'; proc report data=reports.phondata nowd headskip; column hour status N primtime; define hour / group format=hourfmt. 'Hour' center order=internal; define status / group format=$statfmt. width=24 'Status of Problems' center order=internal; define n / format=3. width=8 'Number/of Calls' center; define primtime / mean format=time8. width=9 'Average/Length of/Calls' center; break after hour / ol skip summarize; rbreak after / dol summarize; title1 'Number and Average Length of Calls'; title2 'Received by Technical Support on 31JAN94'; run; /* This code is shown in Example 7 on page 46. */ options nodate pageno=1 linesize=80 pagesize=30; data carsales; length name $ 18; input name $ month numsold amtsold @@; cards; Langlois-Peele 1 3 60000 Langlois-Peele 2 2 50000 Langlois-Peele 3 1 22000 Langlois-Peele 4 4 60000 Langlois-Peele 5 7 105000 Langlois-Peele 6 9 145000 Langlois-Peele 7 3 35000 Langlois-Peele 8 4 60000 Langlois-Peele 9 3 55000 Langlois-Peele 10 8 145000 Langlois-Peele 11 1 22000 Langlois-Peele 12 4 60000 Johnson 1 2 30000 Johnson 2 1 50000 Johnson 3 3 70000 Johnson 4 2 21000 Johnson 5 2 35000 Johnson 6 6 135000 Johnson 7 3 70000 Johnson 8 2 20000 Johnson 9 2 30000 Johnson 10 5 95000 Johnson 11 3 70000 Johnson 12 2 20000 ; proc format; value mnthfmt 1-3 = '1st' 4-6 = '2nd' 7-9 = '3rd' 10-12 = '4th'; proc report data=carsales nowd headline headskip; column name month numsold amtsold avgsales; define name / group width=18 ' Sales/Representative'; define month / group width=8 'Quarter' format=mnthfmt. width=8; define numsold / analysis sum 'Cars Sold/by/Quarter' format=2. width=9; define amtsold / analysis sum 'Total Sales/by/Quarter' format=comma11.2 spacing=7; define avgsales / computed 'Average/Sales' format=comma11.2 spacing=5; compute avgsales; avgsales = amtsold.sum / numsold.sum; endcomp; compute after name; line @4 73*'='; line @4 'Sales totals for ' name $14. +5 numsold.sum 3. @46 amtsold.sum dollar15.2 @62 avgsales dollar15.2; line ' '; line ' '; endcomp; title 'Quality Motor Company'; run; /* This code is shown in Example 8 on page 52. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. options nodate pageno=1 linesize=80 pagesize=60 fmtsearch=(reports); libname reports 'SAS-data-library'; data reports.jobclass; input gender region occupat @@; cards; 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 2 1 1 2 1 1 2 1 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 1 2 3 1 2 3 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 3 1 3 3 1 3 3 1 3 3 1 3 4 1 3 4 1 3 4 1 3 4 1 3 4 1 4 1 1 4 3 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 1 3 2 1 3 2 1 3 2 1 4 2 1 4 2 1 4 2 1 4 2 1 4 2 1 4 2 2 1 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 4 2 2 4 2 2 4 2 2 4 2 2 4 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 3 2 3 3 2 3 4 2 3 4 2 3 4 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 2 2 4 2 2 4 2 2 4 3 2 4 3 2 4 3 2 4 3 2 4 4 ; proc format library=reports; value gendfmt 1='Female' 2='Male' other='*** Data Entry Error ***'; value occupfmt 1='Technical' 2='Manager/Supervisor' 3='Clerical' 4='Administrative' other='*** Data Entry Error ***'; run; proc tabulate data=reports.jobclass format=8.2; class gender occupat; table (occupat='Job Class' all='All Jobs') *(n='Number of employees'*f=9. pctn='Percent of row total' pctn='Percent of column total' pctn='Percent of total'), gender='Gender' all='All Employees'/ rts=50; format gender gendfmt. occupat occupfmt.; title 'Gender Distribution'; title2 'within Job Classes'; run; /* This code is shown in Example 8 on page 59. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. */ /* The SAS data set REPORTS.JOBCLASS and the formats GENDFMT. and */ /* $OCCUPFMT. were created earlier in Example 8 in the code */ /* shown on page 52. */ options nodate pageno=1 linesize=80 pagesize=60 fmtsearch=(reports); libname reports 'SAS-data-library'; proc freq data=reports.jobclass; tables occupat*gender; label occupat='Job class'; format gender gendfmt. occupat occupfmt.; title 'Gender Distribution'; title2 'within Job Classes'; run; /* This code is shown in Example 9 on page 64. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. */ /* The SAS data set REPORTS.JOBCLASS and the formats GENDFMT. and */ /* $OCCUPFMT. were created in Example 8 in the code shown on */ /* page 52. */ options nodate pageno=1 linesize=132 pagesize=60 fmtsearch=(reports); libname reports 'SAS-data-library'; proc format library=reports; value regfmt 1='North' 2='South' 3='East' 4='West' other='*** Data Entry Error ***'; run; proc tabulate data=reports.jobclass format=5. noseps; class gender region occupat; table occupat=' ' all='All Employees', region='Region'*gender=' ' *(n='Count' pctn='%'*f=7.2) / rts=20 misstext='0' box='Job Class'; format gender gendfmt. occupat occupfmt. region regfmt.; title 'Regional Gender Distribution'; title2 'among Job Classes'; run; /* This code is shown in Example 10 on page 68. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. */ /* The SAS data set REPORTS.JOBCLASS and the formats GENDFMT. and */ /* $OCCUPFMT. were created in Example 8 in the code shown on */ /* page 52. */ options nodate pageno=1 linesize=120 pagesize=60 fmtsearch=(reports); libname reports 'SAS-data-library'; proc tabulate data=reports.jobclass format=5.; class gender region occupat; table gender='Gender: ' all='All Employees', occupat=' ' all='All Jobs', (region='Region' all='All Regions') *(n='Count' pctn='% of Category'*f=8.2) / rts=20 box=_page_; format gender gendfmt. occupat occupfmt. region regfmt.; title 'Summarization of Jobs by Region'; title2 'for Each Gender and for All Employees'; run; /* This code is shown in Example 10 on page 70. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. */ /* The SAS data set REPORTS.JOBCLASS and the formats GENDFMT. and */ /* $OCCUPFMT. were created earlier in Example 8 in the code */ /* shown on page 52. The format REGFMT. was created in Example 9 */ /* in the code on page 64. */ options nodate pageno=1 linesize=120 pagesize=60 fmtsearch=(reports) nobyline; libname reports 'SAS-data-library'; proc tabulate data=reports.jobclass format=5.; by gender; class region occupat; format gender gendfmt. occupat occupfmt. region regfmt.; table occupat=' ' all='All Jobs', (region='Region' all='All Regions') *(n='Count' pctn='%'*f=7.2) / rts=20; title 'Summarization of Jobs by Region'; title3 'Data for #byline'; run; options byline; run; /* This code is shown in Example 11 on page 77. */ /* In the book, these data were read from an external file. So that */ /* you will not have to create an external file, the code here uses */ /* a CARDS statement to read the data instream. */ options nodate pageno=1 linesize=132 pagesize=60 fmtsearch=(reports); data radio; infile cards missover; input / (time1-time7) ($1. +1); listener=_n_; cards; 967 32 f 5 3 5 7 5 5 5 7 0 0 0 8 7 0 0 8 0 781 30 f 2 3 5 5 0 0 0 5 0 0 0 4 7 5 0 0 0 859 39 f 1 0 5 1 0 0 0 1 0 0 0 0 0 0 0 0 0 859 40 f 6 1 5 7 5 0 5 7 0 0 0 0 0 0 5 0 0 467 37 m 2 3 1 1 5 5 5 5 4 4 8 8 0 0 0 0 0 220 35 f 3 1 7 7 0 0 0 7 0 0 0 7 0 0 0 0 0 833 42 m 2 2 4 7 0 0 0 7 5 4 7 4 0 1 4 4 0 967 39 f .5 1 7 7 0 0 0 7 7 0 0 0 0 0 0 8 0 677 28 m .5 .5 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 833 28 f 3 4 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 677 24 f 3 1 2 2 0 0 0 0 0 0 2 0 8 8 0 0 0 688 32 m 5 2 4 5 5 0 4 8 0 0 5 0 8 0 0 0 0 542 38 f 6 8 5 5 0 0 5 5 5 0 5 5 5 5 5 5 0 677 27 m 6 1 1 1 1 0 4 4 0 0 1 4 0 0 0 0 0 779 37 f 2.5 4 7 7 0 0 0 7 7 0 7 7 4 4 7 8 0 362 31 f 1 2 2 8 0 0 0 8 0 0 0 0 0 8 8 0 0 859 29 m 10 3 4 4 4 0 2 2 0 0 4 0 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 1 0 1 4 467 24 m 4 4 1 7 1 0 1 1 1 0 7 1 0 0 0 0 0 859 26 m 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 848 27 m 7 2 5 7 5 0 5 4 5 0 0 0 7 4 4 0 4 677 25 f 1 2 8 8 0 0 0 0 5 0 0 8 0 0 0 2 0 222 26 f 3.5 0 2 2 0 0 0 2 0 0 0 0 0 0 0 0 0 833 32 m 1 2 1 1 0 0 0 1 0 0 0 5 0 1 0 0 0 781 28 m 2 .5 7 7 0 0 0 7 0 0 0 4 0 0 0 0 0 783 28 f 1 1 1 1 0 0 0 1 0 0 0 0 0 1 1 0 0 222 28 f 5 5 2 2 6 6 2 2 0 0 0 2 2 0 0 2 2 851 33 m 4 5 3 1 0 0 0 7 3 0 3 3 3 3 3 7 5 859 39 m 2 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 848 45 m 2 2 7 7 0 0 0 7 0 0 0 7 0 0 0 0 0 467 37 m 2 2 7 7 0 0 0 0 7 0 0 0 7 0 0 7 0 859 32 m .25 .25 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 ; proc format; value $timefmt 'TIME1'='6-9 a.m.' 'TIME2'='9 a.m. to noon' 'TIME3'='noon to 1 p.m.' 'TIME4'='1-4 p.m.' 'TIME5'='4-6 p.m.' 'TIME6'='6-10 p.m.' 'TIME7'='10 p.m. to 2 a.m.' other='*** Data Entry Error ***'; value $pgmfmt '0'="Don't Listen" '1','2'='Rock and Top 40' '3'='Country' '4','5','6'='Jazz, Classical, and Easy Listening' '7'='News/ Information /Talk' '8'='Other' other='*** Data Entry Error ***'; run; proc transpose data=radio out=tr_radio(rename=(col1=choice)) name=timespan; by listener; var time1-time7; format timespan $timefmt. choice $pgmfmt.; run; proc tabulate data=tr_radio format=12.; class timespan choice; table timespan='Time of Day', choice='Choice of Radio Program'*n='Number of Listeners'; title 'Listening Preferences on Weekdays'; run; /* This code is shown in Example 12 on page 84. */ options nodate pageno=1 linesize=80 pagesize=18 formdlim=' '; data custresp; input customer factor1-factor4 source1-source3 quality1-quality3; cards; 1 . . 1 1 1 1 . 1 . . 2 1 1 . 1 1 1 . 1 1 . 3 . . 1 1 1 1 . . . . 4 1 1 . 1 . 1 . . . 1 5 . 1 . 1 1 . . . . 1 6 . 1 . 1 1 . . . . . 7 . 1 . 1 1 . . 1 . . 8 1 . . 1 1 1 . 1 1 . 9 1 1 . 1 1 . . . . 1 10 1 . . 1 1 1 . 1 1 . 11 1 1 1 1 . 1 . 1 1 1 12 1 1 . 1 1 1 . . . . 13 1 1 . 1 . 1 . 1 1 . 14 1 1 . 1 1 1 . . . . 15 1 1 . 1 . 1 . 1 1 1 16 1 . . 1 1 . . 1 . . 17 1 1 . 1 1 1 . . 1 . 18 1 1 . 1 1 1 1 . . 1 19 . 1 . 1 1 1 1 . 1 . 20 1 . . 1 1 1 . 1 1 1 21 . . . 1 1 1 . 1 . . 22 . . . 1 1 1 . 1 1 . 23 1 . . 1 . . . . . 1 24 . 1 . 1 1 . . 1 . 1 25 1 1 . 1 1 . . . 1 1 26 1 1 . 1 1 . . 1 . . 27 1 . . 1 1 . . . 1 . 28 1 1 . 1 . . . 1 1 1 29 1 . . 1 1 1 . 1 . 1 30 1 . 1 1 1 . . 1 1 . 31 . . . 1 1 . . 1 1 . 32 1 1 1 1 1 . . 1 1 1 33 1 . . 1 1 . . 1 . 1 34 . . 1 1 . . . 1 1 . 35 1 1 1 1 1 . 1 1 . . 36 1 1 1 1 . 1 . 1 . . 37 1 1 . 1 . . . 1 . . 38 . . . 1 1 1 . 1 . . 39 1 1 . 1 1 . . 1 . 1 40 1 . . 1 . . 1 1 . 1 41 1 . . 1 1 1 1 1 . 1 42 1 1 1 1 . . 1 1 . . 43 1 . . 1 1 1 . 1 . . 44 1 . 1 1 . 1 . 1 . 1 45 . . . 1 . . 1 . . 1 46 . . . 1 1 . . . 1 . 47 1 1 . 1 . . 1 1 . . 48 1 . 1 1 1 . 1 1 . . 49 . . 1 1 1 1 . 1 . 1 50 . 1 . 1 1 . . 1 1 . 51 1 . 1 1 1 1 . . . . 52 1 1 1 1 1 1 . 1 . . 53 . 1 1 1 . 1 . 1 1 1 54 1 . . 1 1 . . 1 1 . 55 1 1 . 1 1 1 . 1 . . 56 1 . . 1 1 . . 1 1 . 57 1 1 . 1 1 . 1 . . 1 58 . 1 . 1 . 1 . . 1 1 59 1 1 1 1 . . 1 1 1 . 60 . 1 1 1 1 1 . . 1 1 61 1 1 1 1 1 1 . 1 . . 62 1 1 . 1 1 . . 1 1 . 63 . . . 1 . . . 1 1 1 64 1 . . 1 1 1 . 1 . . 65 1 . . 1 1 1 . 1 . . 66 1 . . 1 1 1 1 1 1 . 67 1 1 . 1 1 1 . 1 1 . 68 1 1 . 1 1 1 . 1 1 . 69 1 1 . 1 1 . 1 . . . 70 . . . 1 1 1 . 1 . . 71 1 . . 1 1 . 1 . . 1 72 1 . 1 1 1 1 . . 1 . 73 1 1 . 1 . 1 . 1 1 . 74 1 1 1 1 1 1 . 1 . . 75 . 1 . 1 1 1 . . 1 . 76 1 1 . 1 1 1 . 1 1 1 77 . . . 1 1 1 . . . . 78 1 1 1 1 1 1 . 1 1 . 79 1 . . 1 1 1 . 1 1 . 80 1 1 1 1 1 . 1 1 . 1 81 1 1 . 1 1 1 1 1 1 . 82 . . . 1 1 1 1 . . . 83 1 1 . 1 1 1 . 1 1 . 84 1 . . 1 1 . . 1 1 . 85 . . . 1 . 1 . 1 . . 86 1 . . 1 1 1 . 1 1 1 87 1 1 . 1 1 1 . 1 . . 88 . . . 1 . 1 . . . . 89 1 . . 1 . 1 . . 1 1 90 1 1 . 1 1 1 . 1 . 1 91 . . . 1 1 . . . 1 . 92 1 . . 1 1 1 . 1 1 . 93 1 . . 1 1 . . 1 1 . 94 1 . . 1 1 1 1 1 . . 95 1 . . 1 . 1 1 1 1 . 96 1 . 1 1 1 1 . . 1 . 97 1 1 . 1 1 . . . 1 . 98 1 . 1 1 1 1 1 1 . . 99 1 1 . 1 1 1 1 1 1 . 100 1 . 1 1 1 . . . 1 1 101 1 . 1 1 1 1 . . . . 102 1 . . 1 1 . 1 1 . . 103 1 1 . 1 1 1 . 1 . . 104 . . . 1 1 1 . 1 1 1 105 1 . 1 1 1 . . 1 . 1 106 1 1 1 1 1 1 1 1 1 1 107 1 1 1 1 . . . 1 . 1 108 1 . . 1 . 1 1 1 . . 109 . 1 . 1 1 . . 1 1 . 110 1 . . 1 . . . . . . 111 1 . . 1 1 1 . 1 1 . 112 1 1 . 1 1 1 . . . 1 113 1 1 . 1 1 . 1 1 1 . 114 1 1 . 1 1 . . . . . 115 1 1 . 1 1 . . 1 . . 116 . 1 . 1 1 1 1 1 . . 117 . 1 . 1 1 1 . . . . 118 . 1 1 1 1 . . 1 1 . 119 . . . 1 . . . 1 . . 120 1 1 . 1 . . . . 1 . ; data _null_; if 0 then set custresp nobs=count; call symput('num',left(put(count,4.))); stop; run; proc format; picture pctfmt low-high='009.9 %'; run; proc tabulate data=custresp; var factor1-factor4 customer; table factor1='Cost' factor2='Performance' factor3='Reliability' factor4='Sales Staff', (n='Count'*f=7. pctn='Percent'*f=pctfmt9.) ; title 'Customer Survey Results: Spring 1993'; title3 'Factors Influencing the Decision to Buy'; run; options nonumber; proc tabulate data=custresp; var source1-source3 customer; table source1='TV/Radio' source2='Newspaper' source3='Word of Mouth', (n='Count'*f=7. pctn='Percent'*f=pctfmt9.) ; title 'Source of Company Name'; footnote "Number of Respondents: &num"; run; options formdlim=''; /* This code is shown in Example 13 on page 92. */ options nodate pageno=1; data service; input @1 name $10. @12 address $17. @30 city $7. @38 state $2. @41 zipcode $5. @47 date date7. @55 workdone $15. @70 hours 4.1 / cartype & $25. parts; cards; Bert Allen 1803 Knollton Ct. Bristol NC 29345 01jul93 oil change 0.5 Ford T-bird 1990 9.00 Bert Allen 1803 Knollton Ct. Bristol NC 29345 10jan94 replace brakes 2.0 Ford T-bird 1990 15.00 Bert Allen 1803 Knollton Ct. Bristol NC 29345 20feb94 rotate tires 1.0 Ford T-bird 1990 10.00 Bert Allen 1803 Knollton Ct. Bristol NC 29345 20feb94 transmission 5.5 Ford T-bird 1990 25.00 Sara Jones 202 Stargate Dr. Dart NC 29445 07dec93 align frontend 1.5 Chevy Astro 1992 10.00 Sara Jones 202 Stargate Dr. Dart NC 29445 07dec93 rotate tires 1.0 Chevy Astro 1992 10.00 ; proc report data=service nowd noheader spacing=5 ls=80 ps=25; column name address city state zipcode cartype date workdone hours labor parts total; define name--zipcode / order noprint; define cartype / order noprint; define date / order format=date7. order=internal; define workdone / order; define hours / analysis sum format=4.1 width=4; define parts / analysis sum format=dollar8.2 width=7; define labor / computed format=dollar8.2; define total / computed format=dollar8.2; compute labor; labor=hours.sum*34.50; endcomp; compute total; total=labor+parts.sum; endcomp; compute before cartype; line @1 name $20.; line @1 address $20.; line @1 city $8. +5 state $2. +5 zipcode $5.; line @1 cartype $20.; line ' '; line @35 'Hours' @48 'Labor' @61 'Parts' @73 'Total'; line @5 'Date' @18 'Description' @34 'Worked' @49 'Cost' @62 'Cost' @74 'Cost'; line @4 7*'-' @16 15*'-' @34 6*'-' @45 8*'-' @58 8*'-' @70 8*'-'; line ' '; endcomp; break after cartype / summarize ol ul page; title 'Supreme Tire and Auto Repair'; title2 'Service Record'; footnote1 'Labor cost is calculated at $34.50 per hour'; footnote2 'Total cost = Labor cost + Parts cost'; run; /* This code is shown in Example 14 on page 98. */ /* In the book, these data were read from an external file. So that */ /* you will not have to create an external file, the code here uses */ /* a CARDS statement to read the data instream. */ /* Note that the blank lines in the datalines are intentional. Do */ /* not delete them. */ /* Note that in the FILE statement you must supply the name of */ /* your own output file. */ options linesize=132 pagesize=66 nodate pageno=1; data travel; infile cards missover; input acct div $ region $ deptchg $ rptdate : date7. other1-other10 / empid empname & $char35. / dept & $char35. / purpose & $char35. / dest & $char35. / tripid & $char35. / actdate2 date7. / misc1 & $char75. / misc2 & $char75. / misc3 & $char75. / misc4 & $char75. / misc5 & $char75. / misc6 & $char75. / misc7 & $char75. / misc8 & $char75. / dptdate : date7. rtrndate : date7. automile permile / hotel1-hotel10 / phone1-phone10 / peraut1-peraut10 / carrnt1-carrnt10 / airlin1-airlin10 / dues1-dues10 / regfee1-regfee10 / tips1-tips10 / meals1-meals10 / bkfst1-bkfst10 / lunch1-lunch10 / dinner1-dinner10 / busent1-busent10 / total1-total10 / empadv reimburs actdate1 : date7.; cards; 6003 ATW TX MKT 27JUL93 0 0 0 0 0 5 0 5 0 5 1118 ALEJANDRO MARTINEZ SALES & MARKETING MARKETING TRAINING CARY, NC IB8930002519 TXMKT6003 16JUL93 16JUL93 CAR RENTAL INCLUDE $5.00 FOR GAS 11JUL93 16JUL93 36 0.28 92.96 92.96 92.96 92.96 92.96 0 0 464.8 464.8 0 4.57 4.73 0 0 0 0 0 9.3 0 9.3 5.04 0 0 0 0 5.04 0 10.08 0 10.08 0 35.32 35.32 35.32 35.32 35.32 0 176.6 176.6 0 485 0 0 0 0 485 0 970 970 0 0 0 0 0 0 0 0 0 0 0 75 0 0 0 0 0 0 75 0 75 3 0 0 0 0 3 0 6 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7.79 0 7.79 0 7.79 0 0 0 0 0 0 0 0 0 0 36 28.63 36 36 30 0 0 166.63 0 166.63 0 0 0 0 0 0 0 0 0 0 641.57 176.64 179.28 179.28 173.28 541.15 0 1891.2 1611.4 279.8 0 279.8 12JUL93 ; proc format; value category 1='Lodging, Hotel' 2='Telephone' 3='Personal Auto' 4='Car Rental, Taxi, Parking, Tolls' 5='Airlines, Bus, Train (Attach Stub)' 6='Dues' 7='Registration Fees' 8='Other (explain below)' 9='Tips (excluding meal tips)' 10='Meals' 11='Breakfast' 12='Lunch' 13='Dinner' 14='Business Entertainment' 15='TOTAL EXPENSES'; value blanks 0=' ' other=(|8.2|); value $cuscore ' '='________'; value nuscore . ='________'; run; data _null_; file 'output-file' print; title 'Expense Report'; format rptdate actdate1 actdate2 dptdate rtrndate date7.; set travel; array expenses{15,10} hotel1-hotel10 phone1-phone10 peraut1-peraut10 carrnt1-carrnt10 airlin1-airlin10 dues1-dues10 regfee1-regfee10 other1-other10 tips1-tips10 meals1-meals10 bkfst1-bkfst10 lunch1-lunch10 dinner1-dinner10 busent1-busent10 total1-total10; array misc{8} $ misc1-misc8; array mday{7} mday1-mday7; dptday=weekday(dptdate); mday{dptday}=dptdate; if dptday>1 then do dayofwk=1 to (dptday-1); mday{dayofwk}=dptdate-(dptday-dayofwk); end; if dptday<7 then do dayofwk=(dptday+1) to 7; mday{dayofwk}=dptdate+(dayofwk-dptday); end; if rptdate=. then rptdate="&sysdate"d; tripnum=substr(tripid,4,2)||'-'||substr(scan(tripid,1),6); put // @1 'Around The World Retailers' // @1 'EMPLOYEE BUSINESS, TRAVEL, AND TRAINING EXPENSE REPORT' /// @1 'Employee Name: ' @16 empname @44 @44 'Destination: ' @57 dest @106 'Departure Date:' @122 dptdate / @4 'Department: ' @16 dept @44 'Purpose of Trip/Activity: ' @70 purpose @109 'Return Date:' @122 rtrndate / @6 'Trip ID#: ' @16 tripnum @107 'Activity from:' @122 actdate1 / @118 'to:' @122 actdate2 // @1 '+-----------------------------------+--------+--------+' '--------+--------+--------+--------+--------+--------+' / @1 '| | SUN | MON |' ' TUE | WED | THU | FRI | SAT | |' ' PAID BY PAID BY' / @1 '| EXPENSE DETAIL ' ' | ' mday1 mmddyy5. ' | ' mday2 mmddyy5. ' | ' mday3 mmddyy5. ' | ' mday4 mmddyy5. ' | ' mday5 mmddyy5. ' | ' mday6 mmddyy5. ' | ' mday7 mmddyy5. @100 '| TOTALS | COMPANY EMPLOYEE' ; do i=1 to 15; if i=1 or i=10 or i=15 then put @1 '|-----------------------------------|--------|--------|' '--------|--------|--------|--------|--------|--------|'; if i=3 then put @1 '|' i category. @16 automile 4.0 @21 'miles @' @28 permile 3.2 @31 '/mile' @37 '|' @; else put @1 '|' i category. @37 '|' @; col=38; do j=1 to 10; if j<9 then put @col expenses{i,j} blanks8. '|' @; else if j=9 then put @col expenses{i,j} blanks8. @; else put @col expenses{i,j} blanks8.; col+9; if j=8 then col+2; end; end; Put @1 '+-----------------------------------+--------+--------+' '--------+--------+--------+--------+--------+--------+' // @1 'Travel Advance to Employee ...............................' '...................................................' @121 empadv dollar8.2 // @1 'Reimbursement due Employee (or ATWR) .....................' '...................................................' @121 reimburs dollar8.2 // @1 'Other: (i.e. miscellaneous expenses and/or names of ' 'employees sharing receipt.)' /; do j=1 to 8; put @1 misc{j} ; end; Put / @1 'APPROVED FOR PAYMENT BY: Authorizing Manager:' @48 '_________________________________________________' @100 'Emp. # _______' /// @27 'Employee Signature:' @48 '_________________________________________________' @100 'Emp. # ' empid /// @6 'Charge to Division:' @26 div $cuscore. @39 'Region:' @48 region $cuscore. @59 'Dept:' @66 deptchg $cuscore. @79 'Acct:' @86 acct nuscore. @100 'Date:' @107 rptdate / _page_; run; /* This code is shown in Example 15 on page 110. */ options nodate pageno=1 linesize=132 pagesize=40; data poweruse; input plant $ month res_reg res_wtr res_aeh res_gch res_spc res_fld res_area com_wtr com_spc com_gen com_lp com_ip com_fld com_area com_tss; cards; salem 1 5451 1015 9120 409 2017 48 46 96 74 458 269 434 4438 3911 8319 carthage 1 3984 8574 3726 743 6263 48 72 64 37 745 436 251 6473 2615 6743 salem 2 1422 6753 6605 980 1499 47 79 84 48 479 294 423 4476 8732 7162 carthage 2 9584 3872 3894 382 9485 42 37 84 37 162 483 472 8172 3267 8473 salem 3 8736 4673 2717 372 8473 27 64 52 74 366 251 743 6256 9858 4773 carthage 3 8839 9487 2264 326 1638 48 27 78 47 362 157 487 9246 7675 4736 salem 4 7558 8273 7717 574 8362 61 28 98 71 763 225 372 1635 4473 7845 carthage 4 3894 9857 3615 473 4872 26 64 89 38 276 473 212 7485 5748 3872 salem 5 4837 3654 8743 164 7874 25 47 63 67 658 217 461 3787 8462 6473 carthage 5 9558 4938 2839 370 5849 50 48 38 58 498 584 392 4837 8756 4983 salem 6 7487 2761 6376 643 1255 36 62 53 76 184 732 364 9584 5874 7829 carthage 6 8745 4893 2763 849 9817 46 75 48 27 598 326 493 8754 2983 4632 ; proc computab data=poweruse cspace=1; columns jan feb mar qtr1_tot pct1 apr may jun qtr2_tot pct2; columns ytd_tot / noprint; columns jan feb mar qtr1_tot apr may jun qtr2_tot / format=comma8.; columns pct1 pct2 / format=percent8.1; columns jan feb mar qtr1_tot pct1 / mtitle='=First Quarter=' ' '; columns jan / 'January'; columns feb / 'February'; columns mar / 'March'; columns qtr1_tot / 'Quarterly' 'Total'; columns pct1 / ' % '; columns apr may jun qtr2_tot pct2 / mtitle='=Second Quarter=' ' '; columns apr / 'April'; columns may / 'May'; columns jun / 'June'; columns qtr2_tot / 'Quarterly' 'Total'; columns pct2 / ' % '; rows res_reg / '-------Residential------' ' Regular ' ; rows res_wtr / ' Water heating ' ; rows res_aeh / ' All-electric homes ' ; rows res_gch / ' Good cents homes' ; rows res_spc / ' Space heating ' ; rows res_fld / ' Flood lights ' ; rows res_area / ' Area lights ' ; rows res_tot / 'Total Residential KWH' skip ol; rows com_wtr / '-------Commercial-------' ' Water heating ' ; rows com_spc / ' Space heating ' ; rows com_gen / ' General service ' ; rows com_lp / ' Lighting and power ' ; rows com_ip / ' Industrial power ' ; rows com_fld / ' Flood lights ' ; rows com_area / ' Area lights ' ; rows com_tss / ' Traffic signal service' ; rows com_tot / 'Total commercial KWH ' skip ol; rows grnd_tot / 'Total KWH ' dol; rows wtr_tot / '------Usage Summary-----' ' Total water heating' _page_; rows spc_tot / ' Total space heating'; rows fld_tot / ' Total flood lights'; rows area_tot / ' Total area lights'; rows both_tot / 'Total common usage areas' skip ol; jan=month=1; feb=month=2; mar=month=3; apr=month=4; may=month=5; jun=month=6; rowtot: res_tot=res_reg+res_wtr+res_aeh+res_gch+res_spc+res_fld +res_area; com_tot=com_wtr+com_spc+com_gen+com_lp+com_ip+com_fld +com_area+com_tss; grnd_tot=res_tot+com_tot; wtr_tot=res_wtr+com_wtr; spc_tot=res_spc+com_spc; fld_tot=res_fld+com_fld; area_tot=res_area+com_area; both_tot=wtr_tot+spc_tot+fld_tot+area_tot; coltot: qtr1_tot=jan+feb+mar; qtr2_tot=apr+may+jun; ytd_tot=qtr1_tot+qtr2_tot; colpct: pct1=qtr1_tot/ytd_tot; pct2=qtr2_tot/ytd_tot; do col= 5, 10; do row=2, 5, 6, 7, 9, 10, 14, 15; select (row); when (2,9) table{row,col}=table{row,col-1}/table{wtr_tot,ytd_tot}; when (5,10) table{row,col}=table{row,col-1}/table{spc_tot,ytd_tot}; when (6,14) table{row,col}=table{row,col-1}/table{fld_tot,ytd_tot}; when (7,15) table{row,col}=table{row,col-1}/table{area_tot,ytd_tot}; end; end; end; title1 'Anytown Power and Light Company'; title2 'Quarterly Use by'; title3 'Residential and Commercial Customers'; run; /* This code is shown in Example 16 on page 118. */ /* Note that in the FILE statement you must supply the name of */ /* your own output file. */ options nodate pageno=1 linesize=80 pagesize=48; proc format; invalue colplc 'Active'=45 'Placebo'=63; value racefmt 0='Non-White' 1='White'; value gendrfmt 0='Male' 1='Female'; value tmtdgfmt 0='Active' 1='Placebo'; picture percen (round) .=' ( %)' (noedit) other='0009%)' (prefix='('); run; data demog; do i=1 to 200; patient=put(i,z3.); gender=(ranuni(770)<=0.5); height=ranuni(22878)*20+55; weight=ranuni(2179)*170+110; age=ranuni(51602)*65+20; race=(ranuni(7270)<=0.66); tmtdg=left(put((ranuni(76517)<=0.5),tmtdgfmt.)); output; end; run; proc freq data=demog; tables tmtdg / out=t1 noprint; tables tmtdg*gender / out=t2 outpct noprint; run; proc sort data=demog; by tmtdg; run; proc univariate data=demog noprint; by tmtdg; var age; output out=t3 min=min max=max mean=mean q3=q3 q1=q1 nmiss=nmiss stdmean=stdmean; run; proc freq data=demog; tables tmtdg*race / out=t4 outpct noprint; run; proc univariate data=demog noprint; by tmtdg; var height; output out=t5 min=min max=max mean=mean q3=q3 q1=q1 nmiss=nmiss stdmean=stdmean; run; proc univariate data=demog noprint; by tmtdg; var weight; output out=t6 min=min max=max mean=mean q3=q3 q1=q1 nmiss=nmiss stdmean=stdmean; run; data _null_; file 'external-file' print n=ps notitles header=head; set t1(in=in1) t2(in=in2) t3(in=in3) t4(in=in4) t5(in=in5) t6(in=in6); inds+1; col=input(tmtdg,colplc.); if in1 then do; if inds=1 then put #row @13 'Number of Patients' @(col+2) count; else do; put #row @(col) count; inds=0; row+2; end; end; else if in2 or in4 then do; if inds=1 then do; if in2 then put #row @13 'Gender'; else do; row+5; put #row @13 'Race'; end; row+1; end; if in2 then put #(row+gender) @15 gender gendrfmt. @(col-1) count pct_row percen5.; else put #(row+race) @15 race racefmt. @(col-1) count pct_row percen5.; if inds=4 then inds=0; end; else if in3 or in5 or in6 then do; if inds=1 then do; if in3 or in5 then row+3; else row+5; if in3 then put #row @13 'Age (years)'; else if in5 then put #row @13 'Height (inches)'; else put #row @13 'Weight (lbs)'; row+1; end; if in3 or in5 then put #row @16 'Mean (SEM)' @(col-2) mean 4.1 @(col+3) '(' stdmean 4.2 ')' #(row+1) @15 '25th - 75th' @(col-2) q1 4.1 ' - ' q3 4.1 #(row+2) @16 'Min - Max' @(col-2) min 4.1 ' - ' max 4.1 #(row+3) @15 'No. Missing' @(col+3) nmiss 1.; else put #row @16 'Mean (SEM)' @(col-3) mean 5.1 @(col+3) '(' stdmean 4.2 ')' #(row+1) @15 '25th - 75th' @(col-3) q1 5.1 ' - ' q3 5.1 #(row+2) @16 'Min - Max' @(col-3) min 5.1 ' - ' max 5.1 #(row+3) @15 'No. Missing' @(col+3) nmiss 1.; if (in3 or in5) and inds=2 then inds=0; if in6 and inds=2 then put #(row+4) @13 60*'-'; end; return; head: put #2 @67 'Client' #3 @65 'Protocol' #4 @63 'Population' #6 @38 'Table 2.14' #8 @32 'Baseline Demographics' #9 @13 60*'-' #10 @45 'Active' @62 'Placebo' #11 @13 60*'-'; row=12; return; run; /* This code is shown in Example 17 on page 134. */ options nodate pageno=1 linesize=120 pagesize=35; data invntry; input partnmbr $ quantity price @@; cards; B01-03/06 100 5.75 B02-03/08 100 6.60 B03-03/10 79 7.25 B04-03/12 37 7.80 B05-03/14 3 8.40 B06-03/16 15 7.95 B07-03/20 97 8.80 B08-03/25 24 4.25 B09-03/30 18 7.40 B10-03/06 92 7.10 B11-03/08 12 7.20 B12-03/10 9 7.70 B13-03/12 2 8.00 B14-03/14 37 8.80 B15-03/16 22 9.05 B16-03/20 15 9.20 B17-03/25 50 5.75 B18-03/30 50 8.00 B19-04/06 100 10.10 B20-04/08 33 5.90 B21-04/10 41 6.40 B22-04/12 7 6.80 B23-04/14 11 7.50 B24-04/16 17 6.95 B25-04/18 26 7.95 B26-04/20 31 7.20 B27-04/22 99 9.60 B28-04/25 50 3.95 B29-04/30 42 4.60 B30-04/06 87 11.60 B31-04/08 31 6.70 B32-04/10 11 7.10 B33-04/12 8 7.70 B34-04/14 14 8.80 B35-04/16 19 9.05 B36-04/18 17 9.60 B37-04/20 33 8.80 B38-04/22 51 11.20 B39-04/25 50 5.25 B40-04/30 47 5.50 B41-05/06 97 11.80 B42-05/08 13 6.40 B43-05/10 17 6.60 B44-05/12 15 6.80 B45-05/14 2 7.70 B46-05/16 4 6.60 B47-05/18 77 7.95 B48-05/20 11 7.20 B49-05/22 81 8.80 B50-05/25 50 4.15 B51-05/30 31 4.60 B52-05/06 100 13.75 B53-05/08 23 7.05 B54-05/10 59 7.10 B55-05/12 87 7.70 B56-05/14 22 7.95 B57-05/16 83 8.15 B58-05/18 16 8.45 B59-05/20 18 8.90 B60-05/22 29 10.40 B61-05/25 50 4.85 B62-05/30 31 5.25 B63-06/06 100 12.20 B64-06/08 100 7.00 B65-06/10 52 7.20 B66-06/12 43 7.45 B67-06/14 66 7.95 B68-06/16 69 8.05 ; proc report data=invntry panels=99 pspace=15 nowd headline headskip; column partnmbr quantity price; define partnmbr / 'Part Number'; define quantity / format=3. width=7 'In Stock'; define price / format=dollar6.2 'Price'; title "Parts Listing as of &sysdate"; run; /* This code is shown in Example 18 on page 139. */ /* In the book, these data were read from an external file. So that */ /* you will not have to create an external file, the code here uses */ /* a CARDS statement to read the data instream. */ /* Note that in the FILE statement you must supply the name of */ /* your own output file. */ options nodate nonumber linesize=80 pagesize=50; data travel; input dest $char12. air region $ name $ hotel; cards; TORONTO 263 1 GRANT 348 TORONTO 265 1 GRANT 85 TORONTO 270 1 GRANT 255 TORONTO 270 1 FOSTER 357 TORONTO 270 1 FOSTER 268 CHICAGO 550 1 GRANT 396 CHICAGO 560 1 GRANT 344 CHICAGO 625 1 GRANT 720 CHICAGO 630 1 GRANT 800 CHICAGO 645 1 GRANT 537 CHICAGO 645 1 GRANT 486 CHICAGO 645 1 GRANT 516 LONDON 645 3 THOMAS 600 CHICAGO 698 1 GRANT 537 CHICAGO 715 1 GRANT 346 CHICAGO 720 1 FOSTER 420 CHICAGO 720 1 FOSTER 260 CHICAGO 720 1 GRANT 290 CHICAGO 720 1 GRANT 405 LONDON 847 3 THOMAS 585 LONDON 847 3 BECKER 189 LONDON 860 3 BECKER 250 LONDON 875 3 THOMAS 320 LONDON 875 3 THOMAS 250 LOS ANGELES 895 1 FOSTER 465 LONDON 900 3 BECKER 459 LONDON 900 3 THOMAS 480 FRANKFURT 938 3 THOMAS 220 LOS ANGELES 943 1 FOSTER 186 AMSTERDAM 950 3 THOMAS 240 BARCELONA 950 3 THOMAS 780 LOS ANGELES 963 1 FOSTER 338 BARCELONA 976 3 THOMAS 506 LOS ANGELES 976 1 FOSTER 420 BARCELONA 989 3 THOMAS 600 AMSTERDAM 1049 3 BECKER 375 AMSTERDAM 1050 3 THOMAS 435 AMSTERDAM 1050 3 BECKER 360 AUCKLAND 1050 2 NORMAN 660 LOS ANGELES 1050 1 FOSTER 630 AMSTERDAM 1100 3 THOMAS 390 AMSTERDAM 1100 3 THOMAS 260 COPENHAGEN 1100 3 THOMAS 358 COPENHAGEN 1100 3 THOMAS 264 LOS ANGELES 1100 1 GRANT 440 LOS ANGELES 1120 1 FOSTER 880 LOS ANGELES 1120 1 FOSTER 205 BARCELONA 1200 3 GRANT 1125 LOS ANGELES 1200 1 FOSTER 396 LOS ANGELES 1230 1 FOSTER 558 BARCELONA 1234 3 FOSTER 945 LOS ANGELES 1246 1 FOSTER 480 BARCELONA 1295 3 BECKER 390 BARCELONA 1375 3 BECKER 366 BARCELONA 1400 3 THOMAS 910 PARIS 1420 3 BECKER 440 BARCELONA 1454 3 BECKER 850 BARCELONA 1454 3 NORMAN 920 BARCELONA 1454 3 THOMAS 894 BARCELONA 1454 3 BECKER 594 AUCKLAND 1500 2 NORMAN 462 BARCELONA 1500 3 BECKER 540 FRANKFURT 1500 3 BECKER 350 FRANKFURT 1500 3 BECKER 306 PARIS 1500 3 THOMAS 712 PARIS 1500 3 THOMAS 594 FRANKFURT 1523 3 BECKER 284 FRANKFURT 1630 3 BECKER 975 COPENHAGEN 1650 3 THOMAS 426 COPENHAGEN 1684 3 THOMAS 516 COPENHAGEN 1684 3 THOMAS 280 COPENHAGEN 1684 3 BECKER 145 AMSTERDAM 1722 3 THOMAS 420 PARIS 1750 3 THOMAS 615 AUCKLAND 1900 2 NORMAN 570 FRANKFURT 1914 3 BECKER 480 FRANKFURT 1914 3 BECKER 400 FRANKFURT 1914 3 BECKER 540 FRANKFURT 1914 3 BECKER 294 PARIS 1970 3 BECKER 198 AUCKLAND 2000 2 NORMAN 750 PARIS 2000 3 BECKER 340 PARIS 2050 3 BECKER 510 PARIS 2050 3 BECKER 690 SYDNEY 2975 2 NORMAN 800 AUCKLAND 2976 2 NORMAN 640 HONG KONG 2998 2 NORMAN 765 SYDNEY 3020 2 NORMAN 675 SYDNEY 3025 2 NORMAN 1225 SYDNEY 3050 2 NORMAN 729 SYDNEY 3494 2 NORMAN 1000 SYDNEY 3494 2 NORMAN 594 HONG KONG 3600 2 FOSTER 750 HONG KONG 3623 2 GRANT 950 HONG KONG 4000 2 NORMAN 600 HONG KONG 4020 2 NORMAN 792 HONG KONG 4045 2 NORMAN 660 HONG KONG 4238 2 NORMAN 630 HONG KONG 4238 2 NORMAN 594 HONG KONG 4238 2 NORMAN 320 ; proc sort data=travel out=temp; by region dest; data _null_; file 'output-file' print n=ps notitles header=head; retain column; set temp end=last; by region dest; if first.region then do; destnum=0; if _n_ ne 1 then put _page_; end; if first.dest then do; destnum+1; if mod(destnum,2)=1 then column=5; else column=45; if mod(destnum,4)=1 or mod(destnum,4)=2 then row=5; else row=25; totair=0; tothot=0; put #row @column 'Destination' +2 'Airfare' +2 'Hotel' #(row+2) @column dest $12. ; row+2; end; put #row @column +13 air comma6. +2 hotel comma6.; totair+air; tothot+hotel; row+1; if last.dest then do; put #row @column 27*'-' #(row+1) @column 'TOTAL' +7 totair dollar7. +1 tothot dollar7.; if mod(destnum,4)=0 and not last.region and not last then put _page_; end; return; head: pagenum+1; put #1 @25 'Regional Report by Destination' @70 'Page ' pagenum #2 @35 'Region ' region $3.; return; run; /* This code is shown in Example 19 on page 151. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. */ options pagesize=60 linesize=80 nodate nonumber; libname reports 'SAS-data-library'; data reports.attndees; input name $ 1-30 company $ 32-65 #2 addr1 $ 1-30 addr2 $ 32-62 #3 city $ 1-20 state $ 22-23 zip $ 25-31 days 33 sem1 35 sem2 37 sem3 39 sem4 41; cards; Richards, Ansel Network Systems Inc. Suite 110 1892 Creek Parkway Mountain View CA 94040 3 1 . 3 4 Robarge, Andrea Williamson and Murphy Consultants 334 Mine Lake Road Boulder CO 80309 1 1 2 . . Yang, Hong NCBI 1933 Longview Road N. Grafton MA 01536 3 1 2 3 4 Matthews, David Software Associates 938 St. Charles Avenue Houston TX 77002 2 . . 3 4 Williamston, Mary Ann Computer Technologies Mail Stop A-397 3822 Computer Drive Washington DC 20212 3 1 2 3 4 Ginn, Melissa Sun Industries Suite 300 392 Manning Place Rochester MN 55905 2 . . 3 . Paluzzi, Constantine Computer Technologies Mail Stop A-23 3822 Computer Drive Washington DC 20212 3 1 2 . 4 Patel, Sanjay 110 North Adams Drive Kansas City MO 64141 1 . 2 . . Leary, Freeman The Microcomputing Group 2818 Long Street Ithaca NY 14853 2 . . . 4 Jackson, Regina Jackson Consulting Suite 3900 192 Eighth Avenue New York NY 10032 1 1 2 . . Gonzalez, Juan HDS Business Works 29341 West Airport Road Rockville MD 20850 3 1 2 3 4 Tait, Rachel L. Grant Consulting Suite 200 15 Tanager Court Chapel Hill NC 27514 1 1 . . . Jackson, R. M. Southern P & G 10228 Pearson Blvd. Atlanta GA 30341 3 1 2 3 . Sanchez, Jose Advanced Computing Inc. Room 182 201 Valley Drive Los Angeles CA 90024 3 . 2 . 4 Zink, Erin Wellborn Research Suite 730 874 Market Blvd. New Orleans LA 70112 3 1 . . 4 Gutierez, Rose L. Southwest Financial Group MC-204 1000 Taft Avenue Fort Worth TX 76102 3 1 2 . . King, Lonette Simmons Telecommunications 2310 Simmons Drive Waterford CT 06385 3 . 2 3 . Deane, Jordan JDY Consulting Suite 4500 222 West 57th New York NY 10011 3 . . 3 . Lee, Seung Weston Pharmaceuticals 566 Weston Blvd. Baltimore MD 21218 3 1 . 3 . Weeden, Melvin Connash Electronics 8010 Rockside Parkway Oceanside CA 92056 3 . 2 3 4 Petrizelli, Gail 1022 National Drive Buffalo NY 10291 2 . . 3 4 Koslowski, Maria First Financial Bank suite 3130 23 Wayman Tower Cincinnati OH 45267 1 1 2 . . McCloud, Tonya Ammons Insurance Building C, Suite 120 41120 Office Park Drive Seattle WA 98104 1 . 2 . . Dembinski, Zi Nadcom 211 North Cypress Street Long Beach CA 90846 3 . 2 3 4 ; proc sort data=reports.attndees; by name; run; proc forms data=reports.attndees lines=5 down=5 skip=3 across=2 align=0; line 1 name / pack lastname; line 2 company / remove; line 3 addr1 / remove; line 4 addr2 / remove; line 5 city state zip / pack ; title; run; options nonumber; /* This code is shown in Example 20 on page 156. */ /* Note that in the LIBNAME statement you must supply the name of */ /* your own SAS data library. */ /* The data set REPORTS.ATTNDEES was created in Example 19 in the */ /* code shown on page 151. */ options pagesize=50 linesize=80 nodate nonumber; libname reports 'SAS-data-library'; proc format; value daysfmt 1='MONDAY Only Attendee' 2='TUESDAY Only Attendee' 3='MONDAY & TUESDAY Attendee'; value semfmt 1='Networking PCs - 9:00 AM to 11:30 AM Monday' 2='Learning the Basics - 1:30 PM to 4:00 PM Monday' 3='Advanced Topics - 9:00 AM to 11:30 AM Tuesday' 4='Hands-On Workshop - 1:30 PM to 4:00 PM Tuesday'; run; data reports.attndees; set reports.attndees; header1='***************************************************'; header2='****************SCHEDULED SEMINARS*****************'; length comptag $ 10; nametag='NAME: '; if company eq ' ' then comptag=' '; else comptag='COMPANY: '; format sem1-sem4 semfmt. days daysfmt.; run; proc sort data=reports.attndees; by days name; run; proc forms data=reports.attndees(obs=3) lines=13 down=2 skip=2 ; line 1 header1; line 2 days / i=13; line 3 header1; line 4 nametag name / i=2 lastname; line 5 comptag company / remove i=2 pack; line 6 city state / pack i=11; line 8 header2; line 9 sem1 / remove i=1; line 10 sem2 / remove i=1; line 11 sem3 / remove i=1; line 12 sem4 / remove i=1; line 13 header1; title; run; /* This code is shown in Example 21 on page 162. */ options nodate pageno=1 linesize=132 pagesize=55 ovp; data stocks; format date date7.; input date:date7. volume high low; cards; 18JUL88 31216.6 795.22 782.51 19JUL88 20774.4 792.69 776.19 20JUL88 22658.6 791.59 780.05 21JUL88 18183.0 787.81 774.83 22JUL88 21656.2 779.67 763.78 25JUL88 16108.9 775.51 762.90 26JUL88 18280.0 777.85 766.73 27JUL88 21679.6 779.56 764.00 28JUL88 21928.9 779.75 763.74 29JUL88 34470.2 796.25 776.34 ; proc format; picture stockfmt other='000,000,009' (mult=1000); run; proc plot data=stocks nolegend; plot high*date='*' $ volume low*date='o' / overlay haxis='18jul88'd to '29jul88'd by weekday vaxis=by 10; label high='High or Low'; format volume stockfmt.; title 'High and Low Values of the Dow Jones Industrial Average'; title2 'for July 18 to July 29, 1988.'; title4 'High value is labeled with the volume of shares traded on that date.'; footnote ' * High for the Date'; footnote2 'o Low for the Date'; run; quit; /* This code is shown in Example 22 on page 168. */ options nodate pageno=1 linesize=120 pagesize=40; data sales; input item $ site $ sales qtr @@; cards; Tables Denver 9825 1 Tables Norfolk 6624 1 Tables Tampa 3114 1 Chairs Denver 29932 1 Chairs Norfolk 20489 1 Chairs Tampa 32021 1 Lamps Denver 18392 1 Lamps Norfolk 27333 1 Lamps Tampa 36298 1 Beds Denver 12038 1 Beds Norfolk . 1 Beds Tampa 14982 1 Tables Denver 12409 2 Tables Norfolk 8928 2 Tables Tampa 7664 2 Chairs Denver 32465 2 Chairs Norfolk 30876 2 Chairs Tampa 38492 2 Lamps Denver 25463 2 Lamps Norfolk 19988 2 Lamps Tampa 30375 2 Beds Denver 15967 2 Beds Norfolk 12282 2 Beds Tampa 17444 2 Tables Denver 18743 3 Tables Norfolk 7224 3 Tables Tampa . 3 Chairs Denver 40805 3 Chairs Norfolk 29352 3 Chairs Tampa 45784 3 Lamps Denver 20983 3 Lamps Norfolk 21444 3 Lamps Tampa 27403 3 Beds Denver 19832 3 Beds Norfolk 10246 3 Beds Tampa 20698 3 Tables Denver 14795 4 Tables Norfolk 10267 4 Tables Tampa 8756 4 Chairs Denver 37828 4 Chairs Norfolk 28866 4 Chairs Tampa 41727 4 Lamps Denver 22954 4 Lamps Norfolk 17925 4 Lamps Tampa 35072 4 Beds Denver 18863 4 Beds Norfolk 15904 4 Beds Tampa 19676 4 ; proc chart data=sales; vbar site / group=item sumvar=sales type=mean axis=0 to 40000 by 5000 ref=10000 to 40000 by 10000 width=3 space=2 gspace=5 symbol='|'; label sales='Sale Amount'; format sales dollar8.; title 'Average Quarterly Furniture Sales'; title2 'for Four Quarters of 1993'; run; /* This code is shown in Example 23 on page 172. */ options nodate pageno=1 linesize=120 pagesize=40 ovp; data mileage; input age $ gender $ miles @@; label gender='Gender' age='Age of Driver'; cards; 65-up M 7199 65-up F 4502 55-64 M 12304 55-64 F 5428 45-54 M 15701 45-54 F 6915 35-44 M 17916 35-44 F 7653 25-34 M 16683 25-34 F 7124 16-24 M 10718 16-24 F 6047 ; proc format; value $gndrfmt F='Female' M='Male' other='*** Data Entry Error ***'; run; proc chart data=mileage; block age / group=gender sumvar=miles noheader symbol='OX'; format miles comma7. gender $gndrfmt.; title 'Average Miles Driven Annually'; title2 'Grouped by Gender'; run; /* This code is shown in Example 24 on page 176. */ options nodate pageno=1 linesize=120 pagesize=30; data mileage; input age $ gender $ miles @@; label miles='Miles Driven' age='Age of Driver'; cards; 65-up M 7199 65-up F 4502 55-64 M 12304 55-64 F 5428 45-54 M 15701 45-54 F 6915 35-44 M 17916 35-44 F 7653 25-34 M 16683 25-34 F 7124 16-24 M 10718 16-24 F 6047 ; data convert; set mileage; if gender='F' then miles=-miles; run; proc format; picture posval low-high='000,009'; run; proc chart data=convert; hbar age / sumvar=miles subgroup=gender nostats nolegend axis=-8000 to 20000 by 4000; format miles posval.; title 'Average Miles Driven Annually'; footnote 'Symbols for GENDER'; footnote3 ' F = Female'; footnote4 'M = Male'; run;