RATCLIFFE

Technical Services Limited

www.NoteColon.info

NOTE:

Issue 14. March 2004

Hints, tips, and experience for SAS(r) users

 Subscribe and/or view our archive of back issues at NoteColon.info


In this issue:

In the last issue of NOTE: we published a prize crossword. The response was overwhelming, so we have decided to publish another. You'll find details below. Congratulations to Eric Yount who won the first prize and who is now a proud owner of a copy of ASAP (complementSoft's unique software tool for automatically producing diagrams of SAS code). We have the same great prize on offer this time around, so be quick and see if you can also win your own copy of ASAP.

We had a few polite messages in response to the last issue, suggesting that it was a little light on technical content. I hope that you will agree with me that this issue makes up for that by featuring several articles of value to SAS practitioners.

Have fun...

-Andrew Ratcliffe
note.editor@ratcliffe.co.uk


 

SAS-Themed Prize Crossword #2

Demonstrate your knowledge of SAS

Crossword image

Eric Yount won our first prize crossword, featured in issue 13 of NOTE:. The amount of interest that you all showed in the crossword has encouraged us to make a second. As before, there's a prize at stake for the first correct entry received, so there's sure to be a lot of interest in it again. But we hope you have some fun too. You'll find the crossword on our main crossword page on our web site. In the same area you'll also find some other crosswords that you might also find interesting. 

The 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.

You can make as many entries as you like. For each entry we receive, we will respond and tell you if it is correct or not. If it is incorrect, we won't tell you which answers are wrong, but you're free to send us subsequent entries.

Good luck...

 

Return to top...

 

SAS in Parallel

Do more, in a similar amount of time

Version 9 of SAS introduced parallel processing to many of the core procedures, such as PROC SUMMARY. But did you know that you can run whole procedures, or series of procedures and DATA steps, in parallel? SAS/CONNECT's MP CONNECT feature allows you to do this. You can either run parallel streams on separate systems, or on the same system. The secret is to use the RSUBMIT statement with the CONNECTWAIT=NO parameter. 

The following code can be used on a PC running MS-Windows. It establishes a parallel SAS session (named Good), submits some code (PROC OPTIONS) to that session and then, without waiting for the PROC OPTIONS to finish, submits some code (a DATA step with a loop) to the original SAS session.

signon process=good sascmd='c:\PROGRA~1\SASINS~1\SAS\V8\SAS.EXE';

rsubmit good connectwait=no;
   proc options;run;
endrsubmit;

data _null_;
   do i=1 to 100;
      put _all_;
   end;
run;

The log (and output) results from the second session are sent back to the primary session. By default they are held in separate files and you need to use the RDISPLAY statement (or command) to see them in separate windows. However, you can merge them into the primary log/output by using the RGET statement (or command).

Other statements/commands are available to allow you to know what's going on. Most importantly, the WAITFOR command allows you to explicitly suspend execution in the primary session until one or more specified secondaries have finished.

With multi-processing there's always an issue of scalability, i.e. running a task on two processors instead of one won't necessarily mean you get it done in half the time. There are always issues to take into account, such as contention for access to the same resources from the two sessions. However, we have found SAS/CONNECT's MP CONNECT can give extremely valuable time savings, and make use of otherwise under-utilised resources. With some careful design, many suites of ETL (data warehouse extract, transform, and load) code can be made to run much faster, thereby minimising the length of the overnight batch schedule.

 

Return to top...

 

Scheduling the Guide

Running EG projects unattended

Each generation of SAS software brings increased ease-of- use. The introduction of Enterprise Guide (EG) brought such a degree of ease-of- use that SAS was opened-up to a much larger audience. But interactive use is only part of the picture of a typical commercial environment: there is a strong need to run processes on a regular, scheduled basis.

We have found more than one of our clients to be labouring under the false impression that EG projects cannot be used in a scheduled fashion. In fact, you can use a wide range of scripting languages to launch/run chosen EG projects. SAS Note #2696 has the detailed low-down on how to do this with VBscript. Using the steps described in the Note you can run one or more EG projects on a regular basis.

 

Return to top...

 

Data as XML

Using eXtensible Markup Language

There was a time when XML was king of the buzzwords. That is no longer the case, but it still remains very useful. SAS supports XML very strongly, most notably as an engine for the LIBNAME statement and as an ODS destination.

The LIBNAME statement's XML engine is particularly interesting. If your XML data is suitably structured you can point a LIBNAME statement at it (somewhat unconventional since one usually points LIBNAME statements at directories rather than single files) and read it from DATA steps or PROCs as if it was a data set; and, the XML engine is read/write, so you can create XML files simply by creating a data set in a library that is using the XML engine. The following code illustrates this.

libname note XML '/mydir/MyNewFile.xml';
data note.colon;
   month=mdy(1,1,2004); rate=3.4; type='Actual'; OUTPUT;
   month=mdy(2,1,2004); rate=3.5; type='Actual'; OUTPUT;
   month=mdy(3,1,2004); rate=3.4; type='Forcst'; OUTPUT;
run;

But why would you want to store data as an XML file? Why not simply use a data set?! Well, there are some things that you can do with XML files that you can't easily do with data sets. Most notably, you can maintain comments in an XML file, such as who modified it, when, and why. If the data set is to be a control file that is updated manually by administrators, it might be a very good candidate for being stored as an XML file.

The XML data structure is not suited to replacing most data sets, but there is a particular type of data set to which XML is well suited.

 

Return to top...

 

VIEWS Activities

The UK's independent SAS user group

In the last issue of NOTE: we mentioned our prize crossword, and that was very popular. Also, we mentioned VIEWS' forthcoming event featuring Lauren Haworth, and it too proved very popular. Comments from the many attendees (from novices to experts) included "enjoyed all aspects of the course", "Very impressed with knowledge of presenter", and "the entire day provided valuable information as I am a beginner in SAS (the book will be very useful to me)".

VIEWS' next event will be the annual conference in May (19th-20th) in London. You can find details at the VIEWS web site, including a Call for Papers, a Registration form, and a Sponsorship form.

 

Return to top...

 

Online OnlineDoc

Find what you need to know

You'll doubtless be familiar with the SAS OnlineDoc documentation that is shipped on CD with the software, but did you also know that it's freely available on the Internet? So, if you don't have access to your site's copy, you can peruse v8doc.sas.com or v9doc.sas.com.

These valuable resources used to be (trivially) password protected, but no more.

And, if you don't find what you're looking for in the official SAS documentation, head on over to www.sas-l.com where you'll find searchable copies of SAS-L and comp.soft-sys.sas. This site is maintained by InterNext Inc. as a courtesy to the SAS community.

 

Return to top...

 

How Can We Help You?

Advertisement

RTSL (Ratcliffe Technical Services Limited) is one of the leading SAS specialists in the UK. RTSL designs, builds, implements, and maintains SAS-based applications. With our imagination, expertise and analytical skills, we have the ability to help your company manipulate data to make informed business judgments.

Providing services to the SAS community since 1993, RTSL has implemented a wide range of business solutions in a wide range of industries. See the case studies on our web site to get just a flavour of how we could help you. Contact us for further details.

 

Return to top...

 

SAS(r) With Style

Pay attention to presentation as well as content

It has long been a bone of contention in the RTSL offices: what is the basic data storage element of SAS? Is it the "data set", or is it the "dataset"? Actually, we're all in agreement that it's two words, i.e. "data set", but many SAS practitioners vehemently disagree. This may seem a trivial or pedantic point, but good presentation is almost as important as good content - you don't want to distract the reader's attention from your good content with some bad presentation.

You can trace the history of the term and refer to facts like IBM uses two words, but better still you can use a very useful argument-settler: a Google comparison. Voted top brand of 2003, Google is the most popular web search engine. Checking the number of hits returned by Google for two competing words or phrases will give a (non-scientific) comparison of their popularity across the web. You can do this yourself by using Google twice, or you can use one of the sites created specifically for this purpose, e.g. http://www.googlefight.com/ or http://www.onfocus.com/googlesmack/down.asp

Search String sas "data set" sas dataset
Hits from the whole web 125,000 38,500
site: www.sas.com 365 122

As you can see, it's a no-contest: the basic data storage element of SAS is the "data set" (two words).

 

Return to top...

 

XP Day 2003

Agile Programming in London

XP Day 2003, the annual conference for project managers, developers, and testers interested in eXtreme Programming and Agile Development, was held in London in early December last year. As ever, it proved eye-opening and educational. Author of UML Distilled (as featured in our Library), Martin Fowler presented an insightful keynote speech at the start of the second day.

As if to immediately put-down one of the false notions surrounding Agile development, the first paper following day 1's keynote speech was entitled "Agile Project Management". In this presentation, David Putman and Thomas Granier emphasised how a good manager (in any environment) was somebody who could allow their staff to perform at their best. In an Agile environment, they said, this especially includes making sure that the culture and conditions are right for encouraging creativity.

Tim Bacon's paper on metrics (sub-titled Steering With Numbers) followed-up the management theme by discussing the benefits to be gained from metrics, and the pitfalls of using the wrong ones, or using them for the wrong purpose.

Visit the XP Day web site to see the slides from many of the papers. Better still, attend this year's event. Highly recommended.

 

Return to top...

Advertisement

 

Diary

 

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.


World-wide events


May 2004
9th - 12th, SUGI (SAS User Group International), Montréal, Canada. Premier SAS conference world-wide
19th - 20th, VIEWS (UK SAS user group), London, England. Premier technically-focused SAS conference in Europe
23rd - 26th, PharmaSUG (Pharmaceutical SAS User Group), San Diego, California, USA

June 2004
15th - 17th, SFI (SAS Forum International), Copenhagen, Denmark. Premier business-focused SAS conference in Europe.
6th - 10th, XP 2004 (eXtreme Programming), Garmisch-Partenkirchen, Germany. Premier European conference on eXtreme Programming and Agile processes in software engineering.
23rd - 26th, Agile Development Conference, Salt Lake City, Utah, USA.

December 2004
XpDay, London, England. 4th annual Agile Software Development conference. International conference for project managers, developers and testers. Date to be confirmed

April 2005
10th - 13th, SUGI 30 (SAS User Group International), Philadelphia, Pennsylvania, USA. Premier SAS conference world-wide. Date to be confirmed

March 2006
26th - 29th, SUGI 31 (SAS User Group International), San Francisco, California, USA. Premier SAS conference world-wide. Date to be confirmed

 

Return to top...

 

Miscellany - Joining, leaving, back-issues, and legal bits

 

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) 2004 Ratcliffe Technical Services Limited. All rights reserved.
5 Willow Close, Bexley, Kent, GB-DA5 1QY, England.

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,432 subscribers worldwide.

This is a valid HTML 4.01 Transitional document

 

Return to top...