Showing posts from 2009

Progress on the sas7bdat

It is tough at times to be a consultant and get those side projects out of the way. That said, I finally had a chance to really work on the sas7bdat some more over the holidays. Not too much since my personal focus is my kids.

A really tough project interfered since the last time I played with it in September so I was looking forward to the holidays to pass another milestone.

Well, I just managed to create a 100 record dataset with 7 variables, char and numeric. My little Christmas gift to myself.

When I first started work on this project many moons back, I never expected that writing a dataset would be much more difficult than reading one. That was a major mistake. However, the writing has made me really discover a lot more about the structure and how it works plus I have had to step up my coding skills a bit to make it through.

Long road but finally happy to be here after so much time.

Happy New Year everyone.


Calculate a SAS Observation Length

Well, I couldn't find this documented anywhere (someone correct me if I missed it) but the question for the day was how to calculate the SAS Observation Length. After some investigation, here is how it is done (pseudocode):

obsLength = Sum of all of your character lengths + Sum of all of your variable lengths;

if any numeric variables have a length of 8 then
round the obsLength to the nearest factor of 8.

Since the default for numeric variables is a length of 8, the rounding will almost always occur but it is not a guarantee.

I hope this helps others who may need to calculate this value for storage or performance reasons.

What next?

As I can see that shimmer of light at the end of the tunnel I have to start thinking "what do I do with a binary SAS reader/writer?"

I originally started down this path with the goal of avoiding having to read/write SAS using XML Now that I am nearing the finish, I am trying to determine what comes after this (other than a quiet, non-working evening).

Where I am leaning right now is an Excel add-in or something in that space. I think Excel/SAS is one of the biggest areas of opportunity and an area that frankly does not get enough attention, IMO. SQL Server add-ins are another possible option so SAS can be supported in SSIS. It is early in this mulling period though so I would appreciate any thoughts people have on what they would like to see.

Created my first SAS dataset without using SAS

Well, around 14 months ago, I started on a journey to understand the SAS dataset so I could read and write one independently. Originally, I needed the functionality for a client but it became an obsession to figure it out. Client work and personal matters interfered non-stop but I have finally written my first SAS dataset using C# and .NET.

It isn't pretty (no data is in it) but it is a dataset and that is what matters. Putting data in is minor so I am not concerned about that.

A lot of effort still remains to get it all worked out but I am happy to be at this position. After cleaning the code up and finishing it, I plan on making interoperability tools to simplify interfacing with SAS, expecially in areas where SAS needs help (i.e. SSIS, MS Office).

It is a good day but it has taken a brutal amount of hours to accomplish this feat. I would not suggest to others to spend this amount of time on this issue: it is simply mind-numbing.

[Update 07/27/2009]

I just wrote my first data into th…

PM Stories

These are stories I have collected over the years. i hope people enjoy.

Project Managers In Practice (PIMP…sorry, PMIP)

Our first story involves a young PM, new to the project and not very technical

Ok, so I (senior consultant guy) have a project and there are 3 changes requested by the team:

1. Change a label (minor)
2. Allow a user to save their selections made on dropdowns (these select what displays in a grid)
3. Allow a user to change a grid and submit the values to another program

That’s all fine and good. I bid 44 hours to make the changes.

Team now wants a user to not only make the grid changes (#3) but save those changes as well. So PM says change 2 & 3 are now merged. We need to save selections and grid entries.

I said, OK, slight increase in scope, 50 hours total.

PM says, wait, we merged 2 & 3 together so now we only have 2 changes not 3 so it should be a decrease in hours.

PM survival tip #1: Reduce scope by merging letters on the plan and hope no one notices.

Story 2 involve…

Windows 7

Ok, I am testing out Windows 7 and it seems great...except it didn't recognize my printer and wouldn't let me install the driver. It errored out with:

Unable to Install Printer. The printer driver is not compatible with a policy enabled on your computer that blocks Windows NT 4.0 drivers.

Ok, the solution (as is often the case under Vista) is to disable UAC. Don't go looking for a policy setting (it isn't there that I could find and I scoured all of them), don't try to install a local port like Microsoft advices for Windows Server 2003. Just disable UAC and you are good to go.

I know this one isn't SAS related but people really rely on some tips like these when they are beating their heads against the wall.


It will be very rare when I criticize a SAS PR release but this one was a bad release, in my opinion:

It infers that only mid-size businesses use spreadsheets and that it shows a level of immaturity. My current client, a SAS user, is 15x the size of SAS and uses a lot of spreadsheets. Why? because it is easy and it works. Also, let's not use a generic term spreadsheets. EVERYONE uses Excel so put a name on the usage and don't generalize.

I found this sentence the most galling:

Hatch said that the most successful midsized enterprises are much more likely to be using powerful and relevant technologies such as those from SAS, the leader in business analytics software and services.

A business can use SAS and be relevant while also using Excel. Trying to say that someone needs to use SAS end-to-end is the major issue I have today with SAS. SAS is extremely powerful but to say that the…

Microsoft Project and Inserting Columns

I am doing a LOT of work right now with SAS and Microsoft Project using the Microsoft Project interop, Base SAS, and SAS/IntrNet. One of the client requirements was to add in additional columns to the default MS Project columns. Well, I searched high and low and couldn't figure out how to do it. After some slogging, here is what I came up with:

class MsProjectTest
Project p ;
object m = Missing.Value;
string file = @"c:\temp\test.mpp";

public void Process()
Application app = new Application();
p = app.Projects.Add(m,m,m);
Task t = p.Tasks.Add("Test", m);
t.Name = "Test Node";
t.Start = "03/20/2009";
t.Start7 = "03/31/2009";
p.Application.TableEdit("Entry", true, m, m, m, m,
"Start7", "Start Test", 10, PjAlignment.pjLeft,
true, tru…

Silverlight, WCF, SAS, and Demos

I had a client ask, very nicely, if I could showcase some of my work to help make their internal sale. Well, this is all good to me since I could possible get some business in 2009 and I needed to do it anyway.

Well, the only time available was the holiday season so I cranked out a lot of code, learned a LOT about WCF and Silverlight, but was able to get my demo site built.

The site utilizes WCF to talk to SAS on the backend and expose SAS out as a service on the front-end. Things are very secure right now so I have held a lot of the 'what is possible' back so that I don't expose a security hole.

Here is the site:

Silverlight has been the most challenge simply because the tools are still a bit immature and the coding examples are thin, thin, thin but I love the possibilities. The more I work with Silverlight, the more I like it even if the syntax leaves me scratching my head at times.

The examples I put on the web use SAS as a local resource but SAS coul…

Consultants, Idealism, and the Real World

Today, I hit an absolute programming wall. I was deep into my code, client asking for a deliverable date, and I hit a deal-breaker coding moment. I think, we have all had those things happen. You're there in the bowels and suddenly find some code that simply is not going to work and may jeopardize the entire design.

What to do? Well, Google and hope for a miracle. In this case, i got fortunate and finally stumbled onto a solution late into the evening.

However, the issue made me start doing some more research into the particular area I had struggled with and was reading a lot about static vs dynamic languages (this post is not about that). C$ 4.0 recognizes this dilemma and is implementing it but it isn't available now. However, what a firestorm on the web over the addition of dynamic capabilities.

What I realized is how far off the idealists / zealots are from the consultant/business coder.

If I tell my client that I have to rearchitect the 100s of hours of coding, what are th…