|
RATCLIFFE Technical Services Limited |
NOTE: |
|
Issue 10. July 2002 |
Hints, tips, and experience for SAS(r) users |
|
|
Welcome to another issue of NOTE:. After spending an enjoyable week in Paris attending SeUGI mid-June, it is nice to get back to writing some articles for NOTE: and thinking of those readers whom I met in Paris. I'd like to express my thanks to all of you who expressed kind words of appreciation. We have added another SAS-related product to our commercial catalogue: Onyx. You can read more about it in the article in this edition. Needless to say, we have added Onyx to our portfolio of products because we believe it allows SAS customers to get better value for money from their investment in SAS software - and that's got to be good for everybody. -Andrew |
|||
|
|
||||
|
Tools of the Trade - Log Filter (part 2) |
||||
|
Advanced use of Log Filter |
In the last issue of NOTE: we included an article about our free Log Filter tool. The Log Filter will read the Log window from your interactive SAS session (or an external log file) and display a table showing lines from the log that contains errors, warnings, etc. It is something that we find useful in our day-to-day project work. Sometimes we have the need to check a whole directory full of log files. In those circumstances, we use the following code to create one file which can then be scanned by Log Filter. Note the use of an asterisk in the infiles parameter - this is the technique for specifying multiple files.
The small macro reads each log file in turn and writes it to the end of the output file. Before writing each file it will write an extra line that identifies the name of the file about to be included. The format of this line is such that it will be picked-out by Log Filter and displayed in Log Filter's results table, allowing you to easily identify which individual log file contains the errors or warning messages. By the way, Log Filter's preferences allow you to view and amend the strings for which it searches. You will see that it excludes messages related to setinit-expiry. Useful, huh? |
|||
|
Thin-client access to SAS software and data |
Not all SAS users are SAS programmers. Many SAS users are consumers of information, but don't necessarily get involved in the process of producing that information. They just want a simple interface to give them access to what they need. And, in today's increasingly net-based world, the web browser is the de facto delivery tool. So, instead of placing copies of SAS on every SAS user's desktop, you should be considering placing SAS on a server and giving your users access via a web browser. To make this solution work, you need application server software to act as an intermediary between the browser and the server-based copy of SAS. That is what InterNext's Onyx does. Onyx offers many of the same features as SAS/IntrNet. Onyx gives you the power to run your SAS applications using almost any kind of front-end you desire, whether it be web pages (HTML and a scripting language), Java applets, client-side applications, or almost anything else. It can also run on any operating system that the SAS system can run on. In a cost-effective package, Onyx offers business-strength features such as load balancing, an optional built-in web server, web-based administration, and maintains individual users' session states. For more information on how Onyx can help you with your business needs, contact either InterNext or RTSL (the European distributors for Onyx). |
|||
|
Hidden treasures |
We find that people are frequently surprised with what they find on the RTSL web site. It doesn't just contain an online brochure and catalog for the services and products that we market, it also has an extensive "resources" section, and it contains a complete archive of back-issues of NOTE:. The resources section contains four sections: papers, tools, links, and library. The papers section contains papers and presentations that we have made at SAS conferences and events worldwide. They cover a wide range of topics from the award-winning, technical Proactive Debugging to the high-level OOP Needs OOA and OOD. The tools section contains two free downloadable SAS tools that we use in our day-to-day project work - UML Modeller and Log Filter. The links section includes a motley collection of WWW links to useful SAS-related sites. Finally, the library section contains a selection of the publications that we have found (and continue to find) useful in our work. It is split into five sections and includes books that every IT professional should have on their shelf such as Frederick Brooks' Mythical Man Month. Each book is accompanied by a short review from us, and it has links to two popular book stores so that you can get your hands on your own copy as quickly as possible. And, to cap it all, we have a table of contents page, and a search page (powered by Google), so there's no excuse for not finding what you want! |
|||
|
Missing functionality |
V8 of SAS introduced a new function: missing(). The new missing function returns a binary result that tells you whether the function's argument contains a missing value. The argument can be either numeric or character. But what about those users still stuck in V6-land? Well, there has been a similar function available for some time: nmiss(). The nmiss function takes one or more arguments and returns a value indicating how many of the arguments contain missing values. So, simply, using nmiss(myvar) will return the same value as missing(myvar). However, nmiss only accepts numeric arguments. When dealing with numeric missing values, the nmiss function (and the new missing function) is most valuable if you are using some of SAS's special missing values such as .a and .b. When you're using special missing values and you want a simple test to see if a variable contains a missing value of any kind you need nmiss or missing, unless you're content to code "le .z". To my eye, the use of a function such as missing is clearer than "le .z". |
|||
|
ASAP and Onyx |
Winner of PW's business card draw was Marie-Rose Peltier from Sanofi-Synthelabo. Congratulations Marie-Rose, your bottle of South African wine is on its way to you. News. Version 3 of ASAP was recently launched, now in two editions: the Standard Edition and the Visualiser Edition. The Visualiser Edition is a cut-down version of Standard, consisting solely of the Document Manager, the Visualiser, and the ability to browse files in the Editor. This reflects our customers' focus on the diagramming features of ASAP. In addition, complementSoft have used ASAP's templates as a convenient method for distributing two packages of SAS code: Best Practices Clinical Trial Reporting Templates, and Data Mining Modelling Templates. Both were announced prior to SeUGI and were on show to delegates. Onyx (by InterNext) is a new addition to our growing portfolio of SAS-related products. If you have ever considered the benefits that your company could accrue by making SAS data and the power of the SAS system available across your company's intranet (or wider still, across the Internet), now is the time to consider turning those thoughts to actions. Onyx is a cost-effective, business-strength, server software solution that allows you to roll-out thin-client access to SAS data. Onyx is described in more detail in Onyx - the Power of SAS on the Net in this issue of NOTE:. |
|||
|
Indentation |
We briefly touched on indentation back in issue 2, but it is worthy of additional discussion. Most programmers indent lines of their code to indicate blocks and sub-blocks of code. The indentation is a great help in displaying the structure and flow of the code. In addition, I use paired comments - see the example below:
Making programs readable increases their maintainability (and increases your popularity with your colleagues too). Proper use of indentation displays the structure and flow of your program visually (without the reader having to study each statement in detail). Look at this example and see how it demonstrates the hierarchical nature of the SAS syntax.
The indentation makes it easy to visually see that there are two steps (a DATA step and a PROC). The indentation within the DATA step provides additional information so that the wrapped list of variables on the BY statement does not interrupt the structure. Equally, the three parameters for PROC SORT are given equal importance by aligning them equally. This provides the additional advantage of avoiding the unintentional hiding of the NODUPKEY parameter at the end of a long line. The particular style you use is not as important as making sure that you are using indentation to reveal the structure of the code. Indentation is not for making the code look pretty!. Some of the more main-stream languages have utilities that will run through your code and write-out a neatly indented copy based upon the syntax of your code. This is useful for two reasons: 1. It allows a consistent indentation style to be applied to all programs in a suite 2. It is possible for programmers to accidentally indent code wrongly and thus produce a misleading picture If you know of such a tool for SAS code, we'd love to know. |
|||
|
Advertisement |
|
|||
|
|
This diary provides a guide to some of the world-wide events we might like to attend. Those marked with an asterisk are those that we will be attending. If you plan to go to any of the listed events, please let us know. |
|||
|
|
November 2002 March 2003
May 2003 June 2003 |
|||
|
|
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 on our web site at www.ratcliffe.co.uk/note_colon. Please send comments to note.editor@ratcliffe.co.uk. NOTE:
(c) 2002 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 1,592 subscribers worldwide. This is a valid HTML 4.01 Transitional document |
|||