|
RATCLIFFE Technical Services Limited |
NOTE: |
|
|
Issue 12. August 2003 |
Hints, tips, and experience for SAS(r) users | |
|
Subscribe and/or view our archive of back issues at NoteColon.info |
Welcome to issue 12 of our newsletter for SAS practitioners. Most issues cover a mixture of coding, architecture, design, processes, and project management (reflecting the strengths of RTSL) but this issue focuses on coding tips - with good reason... New sources of information are always welcomed by NOTE:, and none are more welcome than a new (free) daily hints & tips newsletter by email from the highly respected Phil Mason. So welcome in fact that we've chosen to dedicate this entire issue to highlight Phil's new newsletter. There's information on how to subscribe, plus we've included (with Phil's permission) a small selection of our favourite recent articles. I hope you agree that Phil's newsletter is a valuable addition to the existing published knowledge on SAS software. Support Phil's efforts by encouraging your colleagues and clients to subscribe to the Woodstreet Newsletter. -Andrew Ratcliffe |
||||||||||||||||
|
|
|||||||||||||||||
|
How to subscribe to Phil's newsletter |
Phil's free newsletter is a daily email delivered to an email address of your choice as either HTML or as plain text. To subscribe, just send an email to tips@woodstreet.org.uk with a subject line of "subscribe sastips-html" or "subscribe sastips-text" (without the quotes). Phil is Managing Director of Wood Street Consultants Limited and there's an archive of previous tips accessible from the Wood Street Consultants' web site at www.woodstreet.org.uk. For those who don't know of Phil, he's a widely respected author of books and papers on SAS topics and can often be seen speaking at SAS user group meetings worldwide. Phil was Chairman and a founding member of VIEWS (the UK's SAS user group). The newsletter tips frequently reference SAS documentation that is available on the Internet. You can sign-up for SAS's free service here. It offers OnlineDoc for both V8 and V9. |
||||||||||||||||
|
A new function in V9 |
Rather than using a more convoluted technique for counting the number of occurrences of a word in a character string, in SAS 9 we can now use the COUNT function. It will simply count the number of sub-strings that occur in a string, optionally ignoring the case (as in my example). Documentation on the count function can be found at http://v9doc.sas.com/cgi-bin/sasdoc/cgigdoc?file=../lrdict.hlp/a002260230.htm [Information on how to obtain a userid/password for this free resource is in The Woodstreet Newsletter above] SAS Log15
data _null_ ; |
||||||||||||||||
|
Tip 23 - Putting a Number Into a Macro Variable (a Better Way) |
|||||||||||||||||
|
Avoid those nasty messages in the log whilst also using fewer functions |
In SAS 9 there is a new function called SYMPUTX which creates a macro variable from a numeric variable without writing a note to the log, and trims leading and trailing blanks. It will use a field up to 32 characters wide and you can optionally tell it which symbol table to put the macro variable into. The example below show how SAS does an automatic type conversion and uses BEST12.2 to convert a numeric to character in line 44. The following line shows how we can explicitly do the conversion and trim the result. The next line shows how to use SYMPUTX to simplify the process. See the following for more information - http://v9doc.sas.com/cgi-bin/sasdoc/cgihilt?file=/help/lrdict.hlp/a002295697.htm&query=symputx#~1 [Information on how to obtain a userid/password for this free resource is in The Woodstreet Newsletter above] SAS Log42
data test ; |
||||||||||||||||
|
Use regular expressions and be more expressive |
The enhanced editor in SAS 8 has been improved in various ways over the old Program Editor. One improvement appears in the find window, which can be accessed by pressing Ctrl-F or using the pull down menu (Edit-Find). There is now the opportunity to tell Find to look in: all the text, just the code or just the comments. There is also the chance to specify regular expression searches, which allow pattern matching. If you are unfamiliar with this you can click on the right-facing triangle next to the Find text box. This has descriptions of things that can be specified in an expression. By selecting one of these the code will be entered in the Find text box, and can be customised. This all works for Replace as well (Ctrl-H). Some examples of regular expressions in a FIND TEXT box
[Don't forget to tick the "Regular expression search" box if you enter an expression manually] |
||||||||||||||||
|
Automatic diagramming of SAS code with ASAP |
In June of this year, complementSoft released Version 4 of ASAP, the innovative code visualisation tool. To its ever expanding customer-base, ASAP provides the ability to automatically create data flow diagrams of SAS code. And in addition, its built-in FTP and Telnet clients allow its users to access SAS code on remote servers, and to execute the code on those remote servers too. ASAP's major features are rounded-out with its syntax-sensitive code editor. ASAP is a pure Java application. With Version 4, ASAP has been upgraded to the latest Java Virtual Machine to enable tighter integration with Version 9 of SAS. Enhancements to directly benefit customers include:
ASAP is used across the widest variety of industries but most notably in pharmaceuticals where SAS code is included as part of the submissions to the drug regulation authorities. ASAP's automatic diagramming is used by the leading drug administration agencies, so if the pharmaceutical companies wish to see their SAS code in the same way as the regulatory authorities, they need ASAP! RTSL is the international distributor for complementSoft products (including ASAP). |
||||||||||||||||
|
Practical business intelligence from Futrix |
In May of this year, Futrix Software Limited announced the release of Version 4 (popular version number!), the latest version of Futrix – the SAS®-based Enterprise Business Intelligence Suite. This new version incorporates many new features that have been requested by clients, and updated technology delivers enhanced performance. Futrix complements any SAS business intelligence implementation, providing advanced and simple reporting and analytical capabilities to users over the web, or using full client installations. It is quick to implement, easy to use and provides almost immediate return on investment. In addition to the existing suite of business decision making and reporting tools, Futrix Version 4 offers a wide range of new analytical capabilities that now enable telecoms companies to investigate churn patterns more closely, health care organisations to manage client behaviour better, financial services organisations to fine tune their investment models and for any organisation better to understand the drivers that impact their businesses. Some of the additional business benefits to be gained by migrating to Futrix Version 4 include:
Visit www.futrix.com to download the latest demonstration version of Futrix. RTSL is a value-added consultancy for sales and implementations of Futrix. |
||||||||||||||||
|
Another useful tool from Qualex |
Qualex Consulting Services, Inc. has just released an updated version of their SAS Tool, "ZipCoder." ZipCoder is a SAS program which displays all U.S. zip codes, cities, area codes, plus basic 2000 and 1990 census data for counties and states. Current as of June 2003, ZipCoder includes over 42,000 zip codes and has powerful searching capability. Using 2000 and 1990 US census data, basic county and state demographic data are provided including population, average household income, and estimated house values and household income. With ZipCoder you can create graphs to compare demographic data between two states or to display high/low state comparisons. ZipCoder also allows you to easily copy graphs to other Windows applications. You can also query county and state census information. All tables and search results can be saved to a SAS data set or exported to HTML, RTF, or PDF. ZipCoder automatically provides the mileage distance between selected two points. You can even view maps based on zip code, city or state using MapQuest (Internet connection required). Context-sensitive help is included. This new version of ZipCoder is for SAS Version 8 only. It includes many new and updated features over the older version for SAS 6.12 which is still available. ZipCoder is free for personal and internal business use only. To download ZipCoder, go to www.qlx.com/zipcoder Qualex offers a wide assortment of SAS Tools available for download from www.qlx.com/tools.htm. |
||||||||||||||||
|
Make your code manageable and maintainable |
The style guru is on holiday but will return in the next issue of NOTE:. |
||||||||||||||||
|
Advertisement |
|
||||||||||||||||
|
|
This diary provides a guide to some of the key world-wide events that we judge to be of interest to SAS professionals. If you visit any of the listed events, please send us an email and let us know what you thought of it. |
||||||||||||||||
|
|
June 2004 |
||||||||||||||||
|
|
You can subscribe and unsubscribe by visiting our web site at www.ratcliffe.co.uk. Or, to subscribe just click here and hit the Send button in your email client; and to unsubscribe, just click here and hit the Send button in your email client. Please do not include a message in the body of the email, it will not be seen by a human! Back issues are available from the archive at www.NoteColon.info. Please send comments to note.editor@ratcliffe.co.uk. NOTE:
(c) 2003 Ratcliffe Technical Services Limited. All
rights reserved. Republication by permission only. You may forward copies only if no fee is involved. Please encourage the recipients of the forwarded copy to subscribe and get their own free copy of NOTE:. NOTE: is a production solely of RTSL and has no affiliation with any other organisation. This edition of NOTE: was sent free to 4,270 subscribers worldwide. This is a valid HTML 4.01 Transitional document |
||||||||||||||||