Every time I think of next year's SAS Global Forum I get the sound of The Flower Pot Men floating around my head - Let's Go To San Francisco. I may only have turned five years old during the 1967 "summer of love", but some of those wonderfully happy and carefree songs (from the likes of The Beach Boys, Beatles, Monkees, Small Faces, Mamas and Papas, Kinks, and Scott Mackenzie) have infiltrated my memories ever since and remain with me. I must make sure I pack some appropriate tracks on my music player before travelling next April.
I'm always full of grand plans for SAS Global Forum papers at this time of year. Sometimes I find the time and put the work in, other times I have to trim my ambitions. Right now I'm keen to rise to conference chair Rick Mitchell's challenge of accommodating 100 posters, so I'm thinking of submitting one full paper, one coders' corner paper, and a poster. Too much? Maybe, but I'm wondering if I can link them and set them around one theme. And then I need to weave some flower power references into them.
Overly ambitious? Maybe, but the deadline for contributed submission abstracts and working drafts of papers and posters is November 19, so I have a few weeks and months to be creative.
I always find the first word of the first paragraph to be the most difficult. And I also find, no matter how familiar the topic may already be to me, that I learn more about the topic whilst I'm writing. That's not to say that writing a paper is necessarily hard, it's just the simple fact that writing makes one think more comprehensively about the topic, and one becomes aware of small gaps in one's knowledge.
So, writing a paper helps me to solidify my own knowledge, and presenting my paper is of benefit to SAS Global Forum attendees (I hope!). It's mutually beneficial. Combined with the benefits of visiting San Francisco (cue the song in my head again!), I'm determined to attend next year's SAS Global Forum and get my papers and poster into the programme.
My comparative lack of hair means I won't have to worry about whether to follow the advice of the late Scott McKenzie and wear flowers in my hair. Phew, that's a relief!
SAS® and software development best practice. Hints, tips, & experience of interest to a wide range of SAS practitioners. Published by Andrew Ratcliffe's RTSL.eu, guiding clients to knowledge since 1993
Monday, 17 September 2012
NOTE: What Am I Reading?
We all try to write data-driven code, or code that provides some degree of flexibility regarding its input data. We see these approaches as reducing maintenance and making the code more robust. There are a number of features in the SAS language that allow us to know more about the data that we're using. Have you come across the DATA step's CALL VNEXT routine? No? Then read on...
The CALL VNEXT routine returns the name, type and length of a variable in use in a DATA step. In this case, "in use" means "in the Program Data Vector (PDV)". The PDV is the area of memory that the DATA step sets aside to hold all variables that are read in or created during execution of the DATA step. Understanding the PDV, how it is constructed, and how it is populated is very important if you are to truly master DATA step programming. CALL VNEXT provides a good insight.
The following log output shows how successive calls to VNEXT reveal details about each successive variable in the PDV. See how VNEXT returns information about first. and last. variables if a BY statement is present, plus _ERROR_ and _N_.
Ian Whitlock's SAS User Group International (SUGI) paper titled "How to Think Through the SAS DATA Step" for SUGI 31 provides a lengthy and detailed exposé of the PDV and other key elements of DATA step programming. Jim Johnson's "The Use and Abuse of the Program Data Vector" from this year's SAS Global Forum (SGF) focuses neatly on the PDV. If you want to know more about the PDV, these papers are excellent sources of information.
Making your programs robust (meaning they don't fail, for example, every time there's the slightest mistaken variation in input data) and making them future-proof (meaning they don't need to be amended and re-tested when, for example, field lengths get longer due to a corporate merger and the introduction of unforeseen data sources) won't keep you busy with maintenance work but will give you time to spend on more productive, innovative activities. CALL VNEXT might just help you in achieving this goal.
The CALL VNEXT routine returns the name, type and length of a variable in use in a DATA step. In this case, "in use" means "in the Program Data Vector (PDV)". The PDV is the area of memory that the DATA step sets aside to hold all variables that are read in or created during execution of the DATA step. Understanding the PDV, how it is constructed, and how it is populated is very important if you are to truly master DATA step programming. CALL VNEXT provides a good insight.
The following log output shows how successive calls to VNEXT reveal details about each successive variable in the PDV. See how VNEXT returns information about first. and last. variables if a BY statement is present, plus _ERROR_ and _N_.
18 proc sql;
19 create view classv as
20 select *
21 from sashelp.class
22 order by sex;
NOTE: SQL view WORK.CLASSV has been defined.
23 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
24 data _null_;
25 set classv;
26 by sex;
27 length vname $32 vtype $1 vlength 8;
28 vname='xx';
29 do while(lengthn(vname) ne 0);
30 call vnext(vname,vtype,vlength);
31 put vname= vtype= vlength=;
32 end;
33 STOP;
34 run;
vname=Name vtype=C vlength=8
vname=Sex vtype=C vlength=1
vname=Age vtype=N vlength=8
vname=Height vtype=N vlength=8
vname=Weight vtype=N vlength=8
vname=FIRST.Sex vtype=N vlength=8
vname=LAST.Sex vtype=N vlength=8
vname=vname vtype=C vlength=32
vname=vtype vtype=C vlength=1
vname=vlength vtype=N vlength=8
vname=_ERROR_ vtype=N vlength=8
vname=_N_ vtype=N vlength=8
vname= vtype= vlength=0
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: There were 2 observations read from the data set WORK.CLASSV.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
Ian Whitlock's SAS User Group International (SUGI) paper titled "How to Think Through the SAS DATA Step" for SUGI 31 provides a lengthy and detailed exposé of the PDV and other key elements of DATA step programming. Jim Johnson's "The Use and Abuse of the Program Data Vector" from this year's SAS Global Forum (SGF) focuses neatly on the PDV. If you want to know more about the PDV, these papers are excellent sources of information.
Making your programs robust (meaning they don't fail, for example, every time there's the slightest mistaken variation in input data) and making them future-proof (meaning they don't need to be amended and re-tested when, for example, field lengths get longer due to a corporate merger and the introduction of unforeseen data sources) won't keep you busy with maintenance work but will give you time to spend on more productive, innovative activities. CALL VNEXT might just help you in achieving this goal.
Monday, 10 September 2012
NOTE: New Ways in Means
There aren't many SAS programmers who haven't used PROC MEANS (or its alter ego PROC SUMMARY) to aggregate (summarise) their data. PROC MEANS is a familiar tool for most SAS programmers, and the process of subsequently selecting specific values of _TYPE_is an equally familiar if slightly more painful activity. If you've ever struggled to select the correct _TYPE_ value(s) then I wonder if you know of the CHARTYPE parameter.
Traditionally, SAS software created _TYPE_ as a numeric variable, and we had to select values based upon a calculation or by use of bit strings. However, version 8 introduced the CHARTYPE parameter to PROC MEANS. CHARTYPE tells PROC MEANS to create _TYPE_ as a character variable. This makes the select process much easier. Compare the following snippets of code.
/* Old Style */
proc means ...
class continent country state town;
output out=old ...
[snip]
data olddemo;
set old;
select (_type_);
when (5) /* country & town */
[snip]
when ('1010'b) /* continent & state */
[snip]
/* New Style */
proc means chartype ...
class continent country state town;
output out=old ...
[snip]
data olddemo;
set old;
select (_type_);
when ('0101') /* country & town */
[snip]
when ('1010') /* continent & state */
[snip]
As you can see, you can select rows which contain your desired class column combination by simply specifying 1's for the columns you want and 0's for those you don't. The length of the _TYPE_ variable is determined by the number of CLASS variables.
If you'd like to learn more about PROC MEANS, I recommend Andrew Karp's excellent SAS User Group International (SUGI) paper titled "Advanced Tips and Techniques with PROC MEANS" from SUGI 27. Andrew covers CHARTYPE and much, much more - all with excellent examples.
Traditionally, SAS software created _TYPE_ as a numeric variable, and we had to select values based upon a calculation or by use of bit strings. However, version 8 introduced the CHARTYPE parameter to PROC MEANS. CHARTYPE tells PROC MEANS to create _TYPE_ as a character variable. This makes the select process much easier. Compare the following snippets of code.
/* Old Style */
proc means ...
class continent country state town;
output out=old ...
[snip]
data olddemo;
set old;
select (_type_);
when (5) /* country & town */
[snip]
when ('1010'b) /* continent & state */
[snip]
/* New Style */
proc means chartype ...
class continent country state town;
output out=old ...
[snip]
data olddemo;
set old;
select (_type_);
when ('0101') /* country & town */
[snip]
when ('1010') /* continent & state */
[snip]
As you can see, you can select rows which contain your desired class column combination by simply specifying 1's for the columns you want and 0's for those you don't. The length of the _TYPE_ variable is determined by the number of CLASS variables.
If you'd like to learn more about PROC MEANS, I recommend Andrew Karp's excellent SAS User Group International (SUGI) paper titled "Advanced Tips and Techniques with PROC MEANS" from SUGI 27. Andrew covers CHARTYPE and much, much more - all with excellent examples.
NOTE: True Self-Service BI With Futrix
Over the last couple of weeks I've featured a couple of 3rd-party SAS-related products (Metacoda security plug-ins and Phil Holland's Ebook/apps). I've said how much I support 3rd-party products. So, I couldn't let this unintentional mini-series end without including the Daddy of them all: Futrix.
Futrix's ability to let its users drill up, down, and across without being constrained by cube definitions or data hierarchies is one of the key attractions of this SAS-based Business Intelligence (BI) tool that has been around since 1997. The ease with which novice users can pick up and use Futrix belies other vendors' claims to ease-of-use. Futrix is ease-of-use personified.
But don't think that ease-of-use equals limited-in-ability. Aside from the ability to drill anywhere (including jumping from one table or cube to another whilst preserving your drill-level), Futrix allows dynamic grouping (for creating categorisations on the fly) and user-defined formulas. The information can be presented in a mixture of tables, charts and dashboards.
Beneath the user interface there's a sophisticated set of administrative tools that include a full security model and the ability to allow Futrix to dynamically tune cubes and its own aggregations.
Product development is rapid, and influenced by customer feedback.
Take a look at the web site, take-up the offer of a free trial demonstration, and take your SAS-based data to a whole new audience!
Futrix's ability to let its users drill up, down, and across without being constrained by cube definitions or data hierarchies is one of the key attractions of this SAS-based Business Intelligence (BI) tool that has been around since 1997. The ease with which novice users can pick up and use Futrix belies other vendors' claims to ease-of-use. Futrix is ease-of-use personified.
But don't think that ease-of-use equals limited-in-ability. Aside from the ability to drill anywhere (including jumping from one table or cube to another whilst preserving your drill-level), Futrix allows dynamic grouping (for creating categorisations on the fly) and user-defined formulas. The information can be presented in a mixture of tables, charts and dashboards.
Beneath the user interface there's a sophisticated set of administrative tools that include a full security model and the ability to allow Futrix to dynamically tune cubes and its own aggregations.
Product development is rapid, and influenced by customer feedback.
Take a look at the web site, take-up the offer of a free trial demonstration, and take your SAS-based data to a whole new audience!
Tuesday, 4 September 2012
NOTE: Celebrates Its Third Birthday
It seems a lot longer, yet today is just NOTE:'s 3rd birthday*. In that time we've published over 300 posts and received over 80,000 page views.
Around 400 people subscribe to our RSS feed, and 200 subscribe to our email feed. We have nearly 150 Twitter followers.
Thank you for your continued interest in NOTE:. I write about what interests me; that's a mixture of SAS technical hints and tips combined with best practice for the software development life-cycle (SDLC), with an occasional mention of gadgetry.
I enjoy writing the blog articles, and I'm glad there's an audience for them. I'm always keen to increase the size of that audience, so if you have a colleague, manager, or team member who might also be interested in NOTE:, please do encourage them to subscribe.
I'm a freelance SAS consultant, and I work through Ratcliffe Technical Services Ltd from the UK. I individually provide a variety of services (covering all points of the SDLC, plus project management and team management), and I also provide additional individuals and teams for clients too. My posts come from a mixture of personal experience plus my avid readership of SDLC and team leadership books and articles.
Here's to the next 300 articles!
-------
* Yes, the very first three posts that you can see on NOTE: are from July 2009, but they were experimental and I didn't commit to the blog until September.
Around 400 people subscribe to our RSS feed, and 200 subscribe to our email feed. We have nearly 150 Twitter followers.
Thank you for your continued interest in NOTE:. I write about what interests me; that's a mixture of SAS technical hints and tips combined with best practice for the software development life-cycle (SDLC), with an occasional mention of gadgetry.
I enjoy writing the blog articles, and I'm glad there's an audience for them. I'm always keen to increase the size of that audience, so if you have a colleague, manager, or team member who might also be interested in NOTE:, please do encourage them to subscribe.
I'm a freelance SAS consultant, and I work through Ratcliffe Technical Services Ltd from the UK. I individually provide a variety of services (covering all points of the SDLC, plus project management and team management), and I also provide additional individuals and teams for clients too. My posts come from a mixture of personal experience plus my avid readership of SDLC and team leadership books and articles.
Here's to the next 300 articles!
-------
* Yes, the very first three posts that you can see on NOTE: are from July 2009, but they were experimental and I didn't commit to the blog until September.
Monday, 3 September 2012
NOTE: A Book That Grows? That's Got To Be A New Concept!
Following my feature of Metacoda and their security plug-ins last week, I have to feature Phil Holland. As I said last week, I'm a keen supporter of the third-party market for SAS-related products. In addition to his two published books (Saving Time and Money Using SAS, and Power User's Guide to SAS Programming), Phil has a collection of apps that act as books but deliver the flexibility of apps. Let me explain.
Phil's apps are available for WebOS, Android, and Chrome. I sat down with Phil and a whole bunch of different bits of his hardware a couple of weeks ago. Phil explained his (unique?) concept to me over dinner and a few beers. The apps are a series of eBooks about SAS software programming. They focus on frequently asked questions and answers, and they are illustrated by code samples. The code samples can be sent by email directly from the app (copy-and-paste would be of no use because the apps are on mobile devices). So far, they sound like relatively conventional eBooks. So, why has Phil developed them as apps?
Phil has designed the eBook/apps to encourage users to contribute additional "how do I do this" questions. Questions (and answers) that are of interest to the wider audience are then added to upgrades of the apps by Phil. The upgrades are delivered free, over-the-air to the mobile devices. So Phil's eBook/app readers get the benefit of additional content, and their books just grow and grow.
The current titles in the series are:
The cost of each is minimal, and there's also a free sample book. With the content coming from Phil, you can be assured of its quality and accuracy.
I think Phil's concept is imaginative and could be applied in many areas, not just SAS. The apps are a relatively new venture for Phil, and I wish him well. Go take a look!
Phil's apps are available for WebOS, Android, and Chrome. I sat down with Phil and a whole bunch of different bits of his hardware a couple of weeks ago. Phil explained his (unique?) concept to me over dinner and a few beers. The apps are a series of eBooks about SAS software programming. They focus on frequently asked questions and answers, and they are illustrated by code samples. The code samples can be sent by email directly from the app (copy-and-paste would be of no use because the apps are on mobile devices). So far, they sound like relatively conventional eBooks. So, why has Phil developed them as apps?
Phil has designed the eBook/apps to encourage users to contribute additional "how do I do this" questions. Questions (and answers) that are of interest to the wider audience are then added to upgrades of the apps by Phil. The upgrades are delivered free, over-the-air to the mobile devices. So Phil's eBook/app readers get the benefit of additional content, and their books just grow and grow.
The current titles in the series are:
- Data Steps
- Platforms
- SQL
- Enterprise Guide
The cost of each is minimal, and there's also a free sample book. With the content coming from Phil, you can be assured of its quality and accuracy.
I think Phil's concept is imaginative and could be applied in many areas, not just SAS. The apps are a relatively new venture for Phil, and I wish him well. Go take a look!
Subscribe to:
Posts (Atom)


