************************************** * Final Project of SAS II * * * * Lang Lu, Jiahong Sheng * * * **************************************; **** Listing of Local Residential Properties ; libname kk 'a:\'; 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 print; 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'; proc contents; run; options nodate pageno=1 linesize=100 pagesize=80 fmtsearch=(housing) center; proc report headline headskip split='*' nowd ls=100 ps=80 colwidth=10 spacing=2 nocenter; *split colwidth spacing; column zone type bedr bath sqfeet age price; define zone / order order=formatted 'zone of*the city' format=$zonefmt.; define type / order order=internal 'type of*the house' width=10 format=$8.0; define bedr / display 'Number of*bedroom' width=9 center format=2.0; define bath / display 'Number of*bathroom' width=9 center format=2.1; define sqfeet / display 'Area' format=comma8.0; define age / display 'age' format=3.0; define price / display ' price' format=dollar10.0; break after zone / skip; title1 ' Listing of Local Residential Properties'; title2 ' Listed by Zone'; title3 " Listing Produced on &sysdate"; run; /* using outrept to store the difinition of the report*/ /* new option noexec, list*/ %let aa=zone; option nocenter; proc report nowd colwidth=10 spacing=2 noheader outrept=kk.kk.aa noexec list ; /*New options: noexec list*/ column zone type n sqfeet price price=pricemax price=pricemin sqfprice comment; /*New option: comment*/ define zone / group noprint format=$zonefmt.; define type / group format=$10.0; define sqfeet /sum format=comma8.; define price / sum format=dollar10.0; define sqfprice/ computed format=dollar8.2 width=19 center; define pricemax / analysis max noprint; define pricemin / analysis min noprint; define comment / computed Format=$15.; define n / format=10.0; compute sqfprice; sqfprice=price.sum/sqfeet.sum; endcomp; compute comment/char length=15; If sqfprice >= 90 then comment='Too expensive'; if 60<=sqfprice<90 then comment='Appropriate'; if 60>sqfprice then comment='Too low'; endcomp; break after zone/ skip suppress; compute before zone; line ' '; line @2 'Zone: ' &aa $zonefmt.; line @2 48*'-'; line @2 '| House value rang from ' pricemin dollar8. +1 'to ' +1 pricemax dollar8. '. |'; line @2 48*'-'; line @3 'House' @30 'Total' @39 'Total' @51 'Dollars'; line @3 'Type' @18 'Quantitive' @30 'Area' @39 'Value' @51 'Per Sqare Feet' @70 'My Opinion'; line @2 ' ャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャ '; endcomp; title1 ' The avalible houses information of the city'; title2 ' By different type'; run; /* using the definition to get reports of different dataset which has the same vriables*/ proc report data=housing report=kk.kk.aa nowd; where type='condo'; run; proc report data=kk.one report=kk.kk.aa nowd ; run; /*use REPORT window to get a report*/ option ls=132; proc report data=housing; run; /* use PROMPT FACILITY*/ title; proc report data=housing prompt; run; **** Price Statistics for All Zones******************* ; proc report data=housing nowd headline headskip ls=100 ps=60; column zone bedr (Min Max Mean ),price; define bedr / group format=2. width=7 'Bedroom'; define zone / order group format=$zonefmt15. width=15 'Zone'; define price / format=dollar10. width=10 'Price'; break after zone / skip; title 'Sales Statistics for All Sectors'; run; **** Calculating Percentages on bedroom ********** ; proc report data=housing nowd headline headskip ls=100 ps=60; column (zone bedr price,(sum pctsum) comment); **new options: (sum pctsum) comment); define bedr / group format=2. width=7 'Bedroom'; define zone / order group format=$zonefmt15. width=15 'Zone'; define price / format=dollar10. width=10 ''; define pctsum / 'Percent of Price' format=percent6. width=8; define sum / format=dollar12. 'Total Price'; define comment / computed width=40 '' flow; compute comment / char length=40; if price.pctsum gt .09 and _break_ = ' ' then comment='Main type '; else comment=' '; endcomp; break after zone / skip; rbreak after / ol summarize; title 'Bedroom Statistics for All Sectors'; run; **** Storing and Reusing a Report Definition *********; libname housing 'c:\temp'; options nodate pageno=1 linesize=140 pagesize=80 fmtsearch=(housing); proc report data=housing nowindows headline headskip ls=100 ps=80 named wrap outrept=housing.reports.namewrap ; ****New option; column zone type bedr bath sqfeet age price; define zone / order format=$zonefmt15. width=15 'Zone'; define type / order format=$8.'Type'; 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; where zone='2'; title 'Listing of Local Residential Properties'; title2 'Listed by Zone'; run; options nodate pageno=1 fmtsearch=(housing); proc report data=housing report=housing.reports.namewrap nowd; **; where bedr=2 and bath=2.5; title 'Listing of Special Residential Properties'; run; **** Vertical Bar Chart for Report ************* ; goptions reset=global gunit=pct border cback=white colors=(black red green blue) ftitle=swissb ftext=swiss htitle=4 htext=1.7 offshadow=(1.5,1.5); title1 'Total Price by Zone'; footnote1 h=3 j=r 'hoursing '; axis1 label=none origin=(20.4); axis2 label=none order=(10 to 1000000 by 200) minor=(number=1) offset=(,0); legend1 label=none shape=bar(2,2) cborder=black cblock=gray origin=(20.4); pattern1 color=orange; pattern2 color=cyan; pattern3 color=lime; pattern4 color=red; pattern5 color=blue; pattern6 color=yellow; proc gchart data=housing ; format zone $zonefmt.; format price dollar12.; vbar zone / sumvar=price g100 subgroup=type width=20 space=4 maxis=axis1 raxis=axis2 cframe=gray coutline=black legend=legend1; run; quit; footnote;