Understand the Work

This post was kindly contributed by The SAS Training Post - go there to comment and to read the full post.

At the end of my first blog, I said I would explain more about those literature analyzing skills and what all that literature stuff has to do with SAS. I showed my “skills list” and discussed how learning to write a SAS program could be compared to analyzing a work of literature. The first item on my list was
“Understand the work.”

Moby-Dick and Finnegans Wake have the reputation of being great literature, but they also have the reputation of being difficult. By the time you’re into the beginning chapters of both books, you might not feel like you’re reading great literature. Both books can seem like they’re not worth the effort to keep going. SAS is like that too. You get that first red ERROR in the SAS log that says “Statement is not valid or it is used out of proper order” or “Expecting a (“ and you really wonder whether you should keep going. Yes, it is worth the effort to keep going. But even before you get that first error message or start coding your program or start writing your analytical paper, you have to understand the work.

In the P.O.E.M. (Professional Organization of English Majors) world, this step does involve actually reading Moby-Dick and Finnegans Wake (and more than once!). But that’s not the end of it, you don’t really understand the work until you’ve got all the particulars about it under your belt. For example, merely reading a work of literature would be no different from reading a beach book if all you did was read the book. When you’re a Lit major, you have to know the Who, What, When, Where, and Why of every novel you read.

When you write an analytical paper on a work of literature, these are examples of the 5 “W’s” that pertain to the actual work itself and its author. But then the paper that you’re writing has its own set of questions that must be answered. Who am I writing this paper for? What is the paper about? What question do I have to answer? What case do I have to argue? What character do I have to explain? How am I going to research the paper? How am I going to write the paper? How am I going to deliver the paper?

However, let’s talk about the “W” questions and how they apply to a SAS project or program. At least you don’t have to read Moby-Dick and Finnegans Wake before you write your program!

Before you even put fingers to keyboard, there are some fundamental “W” and other questions
that you need to be able to answer:

What and Where questions

  • What do you need to do?
  • What version of SAS is available to you?
  • What operating system will you use?
  • What SAS interface will you use? (SAS Enterprise Guide, SAS Windowing Environment, batch SAS with JCL on the mainframe? Interactive SAS via ISPF or ROSCOE or WYLBUR? The SAS Add-in for Microsoft Office?)
  • What data do you need to use?
  • Where is the data coming from? SAS dataset, CSV file, Excel file, Database
    file?
  • Who questions

  • Who is the audience for this work product? If you are producing a report, who is going to get your report? If you are creating a SAS dataset, who is going to use the dataset (and HOW are they going to use it? And WHAT are they going to use it for?)
  • Who is your resource inside the company? Who is the person designated to answer your questions or help you with your task?
  • Why questions

  • Why are you writing this program? Is it a stand-alone program? Is it an ad-hoc program – meant to quickly answer one question? Is it a program that needs to be reused? Is it a program that is part of a larger project? Is this program part of a production system? Is this assignment a maintenance assignment (changing or updating an existing program)?
  • Why are you writing this program? Are you taking over from someone else? Are you the only person in the shop who is a programmer? Are you the only person who knows SAS? Are you writing the program because you are the most experienced programmer? Or, is this program a training assignment? Did you take this program on to show what you could do or were you the last person left in front when everyone else took a step back? Is this a big program or project and you are a member of the team?
  • Other questions

  • Are there any standards or documentation that you can use or need to use to help you understand your task? These might include record layouts for flat files, process flows, database data dictionaries or examples of the output you need to produce.
  • Are there any defined expectations of what your work product should be or should look like?
  • Are there any “housekeeping” tasks that you need to take care of, such as user ID and password on a particular system, getting read access to the data, getting write access to the storage location that you will use for output?
  • Are there any expectations on HOW you will accomplish your task? If everybody thinks that you’ll be using PROC MEANS, do you know why there is a preference for PROC MEANS over PROC TABULATE or PROC UNIVARIATE or PROC REPORT??
  • OK, some of these questions are inching into my other blog topics, so I don’t want to give everything away in this post. But consider how understanding the “WHAT” of the data can help you out when you start writing your program. For example, you find out that the data are in existing SAS datasets. So this answer leads you to your LIBNAME statement(s). Or, you find out that the data are in a raw text file or a “flat” file in ASCII text format. This answer leads you to a FILENAME or INFILE statement. Or maybe your data are in Oracle or DB2 and this
    answer leads you to a LIBNAME statement and possibly PROC SQL with the Pass-Through Facility.

    Answering “WHO” the audience is, may also lead you to answers to the other questions. If the output is for a Marketing Manager or a Sales Manager, they may want summary reports that can be surfaced on the web or the company intranet. If the program output is for business analysts, they may want a SAS dataset or an
    Excel file that they can work with. If the output is for people making follow-up phone calls, they may want printed output, where page numbering and readability on paper is important to them.

    Most importantly, really understanding “WHAT” you need to do in conjunction with “WHO” you’re doing it for, can help you narrow down the answers to the other questions. When your boss comes up to you and says, “Quick, we need to find out for the VP how much money was spent with vendors in South Carolina last year.” The operative terms are “quick” and “VP”. The correct responses are how quick – within the next 15 minutes, within the next hour, by close of business; and in what form – is an email with the grand total number OK, does he or she want paper list broken down by total amount per vendor, or is a detail list of ALL expenditures needed.

    On the other hand, if your boss says “You know, that manual process of recalibrating the framistat is taking longer and longer each month-end. Could you look into whether we can use SAS to replace the process?” Now, the list of questions are the beginning steps in the process of developing your SAS program or set of programs. That’s how you understand the work whether you are writing a paper on a work of literature or whether you are writing a SAS program– by asking questions about the work and finding out the answers to the questions before you
    begin.

    In my next blog, I’ll talk about using the dictionary and how it can help you become a better SAS user. And, as a reward for those of you who were also English majors, here are some of my “W” answers on writing about Moby-Dick.

    Moby-Dick was written by Herman Melville (who). It is a work of fiction (what), loosely based (very loosely based) on Melville’s experience as a sailor aboard the whaling ship Acushnet (more what). Melville primarily wrote the novel at his house, Arrowhead, in Pittsfield, MA (where) . Moby-Dick was published in 1851 (when), after Melville had published a series of more popular novels based on his adventures as a sailor.

    People have written criticism, novels and dissertations on the why of Moby-Dick, and that is a discussion best left to the P.O.E.M. crowd. Find me at a user group meeting and I’ll tell you about my theory on the why of Melville’s Moby-Dick.

    This post was kindly contributed by The SAS Training Post - go there to comment and to read the full post.