|
RATCLIFFE Technical Services Limited |
NOTE: |
|
|
Issue 13. October 2003 |
Hints, tips, and experience for SAS(r) users | |
|
Subscribe and/or view our archive of back issues at NoteColon.info |
This is just a short edition of NOTE: to tell you about an interesting VIEWS event in the UK, and to make sure you know about our great new prize-crossword. We have a superb prize of a one-year licence for complementSoft's automatic diagramming tool ASAP. So, read quickly below, and get on over to the crossword page. Have fun... -Andrew Ratcliffe |
|||
|
|
||||
|
Demonstrate your knowledge of SAS |
|
We have just launched a SAS-themed crossword on our web site. With a prize at stake for the first correct entry received, there's sure to be a lot of interest in it. But we hope you have some fun too. Prize for the first person to email a correctly completed crossword to us is a free, one-year licence for complementSoft's ASAP - the innovative tool for automatically producing data flow diagrams of your SAS code. The winner's name will be published in the next edition of NOTE:, and the solution to the crossword will be published on the web site. So, what are you waiting for? Hop on over to the crossword page now and have a go. Good luck... |
||
|
A greatly misunderstood function |
The LAG function has been around in SAS for many, many years. Over those years it must have been responsible for more grey hairs than many of the other SAS functions put together. Put simply, the LAG function does not return the value of the variable from the preceding row. It often appears to do so, but that's not the actual mechanics of what it does. This has tripped-up many novices over the years, so it's worth repeating again here. So what does the LAG function do? Well, it maintains a stack of values. Each time the lag function is called, it returns the value off of the top of the stack, and puts the current value of the specified variable to the bottom of the stack. If the function is called in non-conditional code, it will have the result that it will always return the value of the variable from the previous row. But if it's used in conditional code, it won't put a value from every row onto the stack, hence some values will never be retrieved from the stack. Consider this code: if x/2 eq int(x/2) then y=lag(x); Looks simple: if x is an even number, put the preceding value of x into y. Ah, but remember, it only returns what has previously been put into the stack. And, values get put into the stack only when the function is called. And in this case, the function only gets called when x is an even number. So, instead of getting the "last" value of x each time you call it, you get the last even value of x. Beware! Used carefully the lag function is very useful. But be sure you understand it before you use it. |
|||
|
A Books by Users event organised by VIEWS |
SAS practitioners able to attend the November 18th VIEWS event in the UK will be treated to a whole day of ODS hints, tips, and experience, rounded out by a session on HTML. Lauren will begin the day by running through the basics of ODS - including HTML, RTF, and PDF output. The morning will continue with a focus on ODS Style Templates. After lunch, the focus will move to tips and tricks, and the usage of the PRINT, REPORT, and TABULATE procedures with ODS. VIEWS is the UK's independent SAS user group. VIEWS' seminars by BBU (Books By Users) authors are tremendously popular. Lauren is travelling from San Francisco specifically for this event. To discover prices, and to book your place at this event, check-out the VIEWS web site at www.views-uk.org. |
|||
|
Think big, but act small |
It is advisable to try to keep your units of code small. Have them focus on doing a good job of one (or two) single elements of functionality. When we talk about units, we are referring to many different things - all dependant upon the job in hand. The advice applies to DATA steps, macros, SCL classes, and anything else that can be modularised. As soon as a unit starts to do too many things, it becomes a Jack of all trades but master of none. Make each unit ignorant of who is calling it. Just make sure that it does its "advertised" job. This will make it robust and useful to a wider range of other programs and applications. Breaking your program or application down into smaller chunks can be seen as making it inefficient. It may be true that it makes it more inefficient at run-time - maybe it uses more processor cycles because it duplicates some of the effort performed in other independent units - but that extra cost is more than offset by the decrease in maintenance costs, i.e. less calls by users to help desks, less debugging and fixing, and less effort to add new features. If you need to enhance a unit and find that it is getting "bloated", don't be afraid to refactor one unit into several. This is a natural process. It happens at design-time for original applications, and it happens during the lifetime of the application whilst it is maintained and enhanced. So, think big, but act small. |
|||
|
A rose by any other name... |
As the SEUGI web site (www.sas.com/seugi) reveals, SAS European Users Group International has become the SAS Forum International. And with a new name comes a new web site: support.sas.com/events/sasforuminternational. No reason for the name change is offered, and there's no suggestion that the content of this year's event will be any different to recent years. It just seems that the "e" issue has finally been resolved - it initially stood for "European" but got de-focused in recent years as the conference took on a greater geographic scope. The event is being held in Copenhagen, Denmark, from the 15th to 17th of June 2004. |
|||
|
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. |
|||
|
|
December 2003 May 2004 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 3,953 subscribers worldwide. This is a valid HTML 4.01 Transitional document |
|||