----------------------------------------------------------- The Boston Area SAS Users Group Message List - February 5, 2000 ----------------------------------------------------------- Contents: - Quarterly Meeting, March 2, 2000 - Our Web Site - BASUG Contacts - How to subscribe/unsubscribe from this Message List ----------------------------------------------------------- ----------------------------------------------------------- Meeting Announcement ----------------------------------------------------------- ----------------------------------------------------------- WHAT: Quarterly BASUG Meeting WHEN: Thursday, March 2, 2000 - 8:30AM to 12:30PM WHERE: BIOGEN, Inc. Bio6- Research Bldg 12 Cambridge Center (6 story brick building) Cambridge MA 02142 (Directions below) Main Telephone: 617-679-2000 / 800-262-4363 http://www.biogen.com THEME: "Winter Stew: A Tasty Blend of V8, ODS, and Brain Teasers!" AGENDA: 8:30 Coffee and registration 9:00 "What's New in Version 8 of the SAS System?" 10:00 "Making Friends with ODS and PROC TEMPLATE" 11:00 "Puzzlers" RSVP: If you plan to attend the meeting, please send an e-mail to: Tim_Muir@biogen.com CONTACT: Elizabeth Axelrod Tel: (617) 349-2458 E-mail: elizabeth_axelrod@abtassoc.com ----------------------------------------------------------- ABSTRACTS AND BIOS: ----------------------------------------------------------- 9:00 - 10:00 "What's New in Version 8 of the SAS System?" by Paul Grant This presentation will demonstrate some of the exciting new features in Version 8 of the SAS System. We'll start by looking at the enhanced SAS Workspace including the SAS Explorer, the Results window, the Enhanced Editor. Along the way, we'll talk about many of the key enhancements to the SAS DATA step and BASE SAS Procedures. The goal of this presentation is to help you get up and running with the powerful new features of the SAS System as soon as your Version 8 CD arrives. ----------------------------------------------------------- 10:00 - 11:00 "Making Friends with ODS and PROC TEMPLATE" by William Simpson The Output Delivery System (ODS), including a much expanded and modified version of PROC TEMPLATE, is a new feature of SAS versions 7 and 8. Using ODS and the version 7/8 PROC TEMPLATE, users have much greater control over formatting and display of output than in version 6. Among the new features: anything that appears on printed output can be routed to a SAS data set; output can be sent to HTML and other destinations as well as the listing file; and procedure output can be customized in many ways. However, learning to use ODS features can be a bit tricky -- the PROC TEMPLATE documentation was not ready in time for inclusion in release 7, and there are only a few "how to" papers available on using ODS. This paper provides step-by-step examples for using ODS, including PROC TEMPLATE, to customize procedure output. Examples include: reducing the amount of output by excluding unneeded information; changing the number of significant digits in printed results; using various techniques to emphasize certain numbers in the output; and saving results to output data sets. The talk is designed for users with no prior experience with ODS, and may also be useful to those who have used ODS but would like to learn more. ----------------------------------------------------------- 11:00 - 12:00 "Puzzlers" by Bob Virgile This presentation presents solutions to 12 brain teasers, developed by Bob Virgile for previous NESUG and SUGI problem-solving contests. For this users group meeting, particular questions were selected for a variety of reasons. All questions involve knowledge of the DATA step. None of them appeared in Bob's book of puzzles (An Array of Challenges: Test Your SAS Skills, published by SAS Institute). Some are instructional. Some work together, presenting a similar theme from a different point of view. Some are clever. All of them should be good clean fun! For the best learning experience and the most fun, try to solve the problems before the meeting. You will find the problems listed at the end of this announcement. In addition, we have posted them on the BASUG website at: http://world.std.com/~mmurphy/puzzlers.htm ----------------------------------------------------------- Paul Grant is a Systems Engineer at SAS Institute's Boston regional office. He has been active in SAS user groups for many years. He originated the Coders' Corner, Sunday Workshops and Random Access Lunch sections at SUGI and NESUG. He chaired the SUGI 21 conference in Chicago, 1996, co-chaired the NESUG '94 in Philadelphia, 1994, and served as chairperson for the Boston Area SAS Users Group from 1997 - 1999. Paul has been using SAS software in a variety of industries since 1981. William Simpson is a Senior Statistician/Analyst at the Faculty Research Computing Center of Harvard Business School, where he provides statistical consultation and programming for a wide variety of research projects. He also works as an independent statistical consultant, and has been a SAS programmer and consultant for 13 years. He has been using version 7 for less than a year, and is making new friends among the ODS folks at SAS tech support. Bob Virgile is a SAS veteran, having participated in every NESUG and many SUGI, MWSUG, PharmaSUG, and SESUG conferences. Besides presenting papers, Bob creates the problem-solving contests for SUGI and NESUG, and has published two books through SAS Institute. Bob also has developed and taught SAS courses since 1983. ----------------------------------------------------------- DIRECTIONS: ----------------------------------------------------------- (Parking at the Biogen lot is $18; the Marriott Hotel is $13. Consider parking at either end of the Red Line (Braintree or Alewife) and subwaying to Kendall Square.) From Logan Airport and Boston - Take Sumner Tunnel to Expressway (Rte. 93). - Follow up ramp for 1/4 mile following signs for Storrow Drive. - Take Storrow Drive to left exit marked Kendall Square. - Follow across Longfellow Bridge over Charles River onto Broadway. - Follow Broadway to the 3rd light (OSF brick building will be on your right) - take a right onto Binney. - Street will curve right - take second right to parking garage and Biogen's buildings Bio2 and Bio6. From the West and Mass Pike - Take the Massachusetts Tpke.-I90 to the Cambridge/Brighton Exit - following toward Cambridge after tollbooth. - Go straight across River Street Bridge and take right onto Memorial Drive East - the Charles River will be on your right. - Follow Memorial Drive - road will fork - stay to left and follow up and over bridge. - At the first light after the bridge take a left turn onto Amesbury St. - Hyatt Hotel will be on your left. - At the end of the street take a right onto Vassar St. - Follow Vassar through the 1st light - crossing Massachusetts Ave. to 2nd light - make a soft left crossing over Main St. - Straight through 3rd light crossing Broadway onto Binney. - Street will curve right - take second right to parking garage and Biogen's buildings Bio2 and Bio6. From the North - Rte. 93 South to Storrow Drive and take left exit marked Kendall Square. - Follow across Longfellow Bridge over Charles River onto Broadway. - At 3rd light (OSF brick building will be on your right) - take a right onto Binney. - Street will curve right - take second right to parking garage and Biogen's buildings Bio2 and Bio6. or - Rte. 93 South to Storrow Drive and take 1st right exit at Nashua St. - Bear right in front of the Museum of Science onto McGrath O'Brien Hwy. - Take left at 1st set of lights onto First St. - Take right at Kendall Square sign onto Binney St. - Follow Binney for several blocks. Biogen buildings Bio2 and Bio6 will be on your left just before curve in road, next to parking garage. From Rte. 2 and Waltham - Rte. 2 to Alewife Brook Pkwy. to Fresh Pond Pkwy to Memorial Dr. - the Charles River will be on your right. - Follow Memorial Dr. - road will fork - stay to left and follow up and over bridge. - At the first light after the bridge take a left turn onto Amesbury St. - the Hyatt will be on your left. - At the end of the street take a right onto Vassar St. - Follow Vassar through the 1st light - crossing Massachusetts Ave. to 2nd light - make a soft left crossing over Main St. - Straight through 3rd light crossing Broadway onto Binney. - Street will curve right - take second right to parking garage and Biogen's buildings Bio2 and Bio6. By MBTA - Train - Take the Red Line Train to Kendall Square stop - Come up from train station cross Main Street and go through the Cambridge Marriott to Broadway. - Exit front of the Marriott and go left on Broadway. - Pass CDM building on right and take right onto access road. Biogen's buildings Bio and Bio2 will be on your right across from parking garage. ----------------------------------------------------------- ----------------------------------------------------------- The Puzzlers ----------------------------------------------------------- ----------------------------------------------------------- 1. (NESUG 1997, #1) Both start and finish are SAS dates which occasionally take on missing values. What is wrong with this logic? (Give the reason, not just the correction) if start and finish then duration = finish - start; 2. (NESUG 1996, #9) What will this program generate? Describe the error message (if there is one) or the output data set (if there is one). data names; do i=1 to 5; select (i); when (i=5) name='Amy'; when (i=4) name='Fred'; when (i=3) name='Paula'; when (i=2) name='Robert'; when (i=1) name='Michael'; otherwise name='Mitchell'; end; output; end; 3. (SUGI 1997, #5) In the following DATA step, create the variable oddeven, giving it a value of 1 for all odd numbered observations and 0 for all even numbered observations. Just to make things challenging, do it by adding only one statement. data new; do until ('SAS' > 'SPSS'); set old; output; end; 4. (SUGI 1996, #4) What message does the put statement generate, if any? data _null_; do i=1 to 100,000; total + i; end; put total=; 5. (NESUG 1997, #8) In the following program, loops takes on two different values. What are they? Why? data improved; set fruit; loops=0; do x=1 to 3, y=3 to 5; loops + 1; end; 6. (NESUG 1998, #9) Under what conditions, if any, will new contain exactly two observations? data new; if mod(_n_,2) then set old; 7. (NESUG 1996, #7) Percents contains one observation per state/gender combination, for example: STATE GENDER PERCENT AL F 0.5092 AL M 0.4908 AS F 0.4735 AS M 0.5265 The following program attempts to summarize total number of voters by state, and then apply the percents data to estimate male and female voters in each state. Where does it go wrong? proc summary data=usa nway; class state; var voters; output out=totals sum=; data estimate; merge totals percents; by state; voters = percent * voters; 8. (SUGI 1996, #1, modified) In this many-to-one merge, there could be mismatches. How many observations were accepted from the each data set? Modify the DATA step so it prints the number. You can assume that the variable age appears in many, but not in one. data teenager; merge many one; by id; if (13 <= age <= 19); 9. (SUGI 1997, #4) How could this program have produced the listing below? data citizens; merge princes (in=in1) paupers (in=in2 where=(money > .)); by LastName; if in1 and in2; proc print data=citizens noobs; var lastname money; format LastName $8. money; LASTNAME MONEY Carter 1000 Carter . Kennedy 1000000 Kennedy . Kennedy . Nixon 300000 Nixon . 10. (SUGI 1997, #10) For the 20 numeric variables V1 through V20, find all subsets which sum to 1000. A few notes: a. A subset contains anywhere from 1 to 20 variables b. Your program must work for many obs, not just one. c. All variables take on integer values. There are no missing values, but there may be negative numbers. "Find" means any form of identification such as printing or outputting to a data set. For this sample set of values: V1 V2 V3 V4 V5 ... 200 300 500 1000 500 your program must "find" all of these combinations: V1 + V2 + V3 V1 + V2 + V5 V3 + V5 V4 While macro language is unnecessary, feel free to use it if you would like. If you do try to test your program on a computer, be careful. There are over a million subsets of 20 variables. 11. (SUGI 1998, #1) In this DATA step, old contains four variables and one observation, but new ends up with just two variables and one observation. Create a version of old to make this happen. data new; set old; 12. (SUGI 1999, #5) The data were supposed to be clean, containing one observation per ID. Instead, they contain multiple observations per ID, with occasionally inconsistent information. For example, the data might contain the following observations: ID N1 N2 N3 C1 C2 C3 ========================================== A . 25 . Be Good A 12 . 5 A Good A 10 25 . Result Your job is to consolidate this type of data into one observation per ID. The data above should become a single observation: ID N1 N2 N3 C1 C2 C3 ========================================== A 12 25 5 A Good Result If the same variable contains conflicting values (see N1 and C1 above, for example), use the value from the observation that contains fewer missing values. To get full credit, your solution must rely on knowing neither the names of the variables, nor the number of observations per ID. You can assume that the incoming data contain at least one character variable (besides ID) and at least one numeric variable. ----------------------------------------------------------- ----------------------------------------------------------- BASUG Web Site ----------------------------------------------------------- ----------------------------------------------------------- Our site on the World Wide Web always contains the latest information concerning upcoming meetings, positions available, and consultants for hire. There are new job openings added by local companies nearly every week. Check us out at: http://world.std.com/~mmurphy/basug.html ----------------------------------------------------------- ----------------------------------------------------------- BASUG Contacts: ----------------------------------------------------------- ----------------------------------------------------------- The Boston Area SAS Users Group (BASUG) // e-mail: basug@world.std.com // WWW: http://world.std.com/~mmurphy/basug.html // US Mail: PO Box 253, Boston 02117 ----------------------------------------------------------- ----------------------------------------------------------- How to subscribe/unsubscribe from our message list ----------------------------------------------------------- ----------------------------------------------------------- The BASUG message list notifies subscribers of the latest plans concerning meetings, classes, conferences, and employment news of interest to local SAS users. To subscribe by e-mail: 1. Send a message to Majordomo@world.std.com 2. In the body of the message, put the following: subscribe basug To unsubscribe: 1. Send a message to Majordomo@world.std.com 2. In the body of the message, put the following: unsubscribe basug