Thursday, February 3, 2011

The Powerful SAS Macro

In SAS, there are three main types of code: the DATA step, procedures (PROC), and the macro language. The macro language is incredibly powerful. It allows users to create dynamic programs, either by conditional logic, iterations, or a combination. A macro program can be as simple as running the same exact DATA step the same way every time, or as dynamic as generating custom code based on the input. (See here and here for more information on the macro language. For some examples of general-use macros, see my macro site.)

As a visual demonstration of the power of the SAS macro language, here is a comparison of SAS code and log output, printed on paper with a similar format:


SAS code (33 pages), including project-specific macros (13 pages)
(Courier New font, size 10; 1.5 line spacing; .5" margins)


SAS log from above code (391 pages)
(Courier New font, size 10; original line spacing; .5" margins)

(Note: The SAS log is a record of what SAS has done. When code is run, it documents input and output record counts, issues like warnings and errors, run time, and other information. See this page for more information.)

The code was formatted with 1.5 line spacing, although the line spacing in the log was left as-is. Additionally, the code included general-use macros (macros not specific to this project), which were not included in the printed code, but would have printed log output upon use. For example, the DUPCHECK macro, used for identifying and resolving duplicates, was used often. As one line of code, it generates, in the simplest example, 42 lines of code. (For an example of its use, see code and log.)

Even so, the ability to do so much work with so few lines of code is incredibly powerful and efficient. I am able to save time and energy, make processing more efficient and effective, simplify and standardize code, and share processes with other users. If you are a SAS user and you do not know the macro language, I encourage you to start learning!

Saturday, January 22, 2011

Kindle Review from a Newbie

I received a Kindle for my birthday last month, and ever since, I have had it with me quite a bit. I've read a number of books, online articles, downloaded articles/books (hello Gutenberg project!), personal documents, PDFs, and alternate ebook formats (e.g., text, Mobi). I've also viewed images, listened to music, played games, and listened to articles with the text-to-speech feature.

My first impression? AWESOME. This is one of the most useful devices I own, and it has helped me face a mounting task: to read that which I "should" read, including articles for work, research articles, random pages online, Wikipedia entries, classics I should have read in school, and simply books I've been meaning to read for a long time.

Further, the device is extremely useful for work. I don't have to print out long documents for meetings: I simply load them on to the Kindle. (I don't have the 3G version, which is fine by me. I don't want to pay extra fees for content delivery, and the USB cable is easy enough to tote to work where there's no WiFi.) I maintain a project list as a text file with current items on the first page and completed items on the second page. Once it fills up I plan to archive it for review purposes.

The capability to search, easily navigate a document, and have a document anywhere has been immensely useful, especially during critical moments in a meeting when someone says, "I think that's documented in that XYZ document that I've either printed out a 150-page version of and will take me 15 minutes to find or I did not print it or I left it at my desk, so none of us will know the answer until later." Just yesterday we were fumbling around trying to figure out the next date we should meet, when we should run a process, and when we should communicate by email or phone. I opened up a PDF calendar I loaded and it made planning much easier.

Of course, this could be done with just about any e-reader, right? Yes, but the Kindle has that iPod-like cool and ease-of-use. The ease-of-use is really the big advantage. The Kindle loads quickly, turns pages quickly (except in some PDFs, especially those with too many images), has an excellent organization method ("collections", where a book can be located in multiple collections), a "newspaper" feature with auto-archiving of old "editions", and all the other features I mentioned above. It's also comfortable to hold and it has the potential for more capabilities. For example, it has a microphone with no known current use, but I imagine that voice commands (e.g., "turn page") would be an excellent addition, especially for people with disabilities.

Even though people complain that it has a locked-down ebook format, so do the other e-readers, especially the Nook, which claims it doesn't. Barnes and Noble use a more open standard, but they still lock it down with DRM, making it practically inaccessible to other ereaders. And frankly, there are ways around these limitations, as any savvy computer geek can find a way to break DRM. (Hopefully, those people are being honest and not selling or distributing copies.)

Have I had any hiccups? Yes. First and foremost: DO NOT BUY THE NON-LIGHTED COVER BY AMAZON!!! Due to its construction, it causes the Kindle to short and restart, seemingly at random. It is not the Kindle. It is the cover! The lighted cover is fine, in fact, I exchanged the non-lighted cover for the lighted cover, and I haven't had any problems with it restarting since. (Caution: The lighted cover costs a bit more, almost half of the cost of the Kindle!)

Additionally, I've had some odd problems with PDFs. Sometimes viewing PDFs with a lot of images makes the page turns very slow. PDFs maintain the format, so they are often hard to read in the default orientation. Rotating the orientation to landscape helps with that problem. It's possible to load images onto the Kindle, which is a hidden, experimental feature. The images look similar to the screen savers, and are a bit slow to navigate as well. Simply put, it's not a device built for handling images (yet). So really not too many drawbacks directly related to the Kindle!

Overall, it's a great device. Easy to use, flexible, and quite frankly, beautiful. My wife says, "It's not beautiful - it's sexy." Please note: she said that, not me.

Sunday, November 14, 2010

AHIP Answers

I use Google Analytics to observe the trends on my site, including this blog. Searches including the term AHIP (America's Health Insurance Plans) have a high hit rate, including the following phrases:
  • AHIP certification test questions
  • AHIP course [material | answers]
  • AHIP final exam questions
  • AHIP fundamentals of health insurance part a [answer | exam | tips]
  • AHIP practice test questions
  • AHIP questions
  • AHIP study [guide | material]
  • AHIP test [answers | help | tips]
  • answers [for AHIP | to the AHIP exam]
  • how to study for AHIP test
  • passing the AHIP test
  • sample questions of the AHIP
  • what is hardest part of the AHIP test in 2010
Long list, right? It would seem there are people desperate to find answers on AHIP examinations. Well, I would like to tell everyone what the answer to every AHIP exam question is:
  1. Read the material!
It's as simple as that. All the answers and how to study them are there. To help, you could take notes, make flash cards, use the provided study guide, etc., which are all basic study skills. Trying to avoid reading the material is not only lazy, but deceitful, and rather defeats the purpose of the AHIP courses and exams: to educate people about the American insurance system, especially targeted for those people who work in the system. Now why would you want to cheat your way through that? Isn't the system broken enough? Do you really need to contribute to it by cheating on a simple test?

Now, if you're reading this and you have an exam coming up, turn off the screen, pick up the book, and start reading.

    Sunday, October 24, 2010

    2010 Goals Revisited

    Earlier this year, I wrote about goals for 2010. Here are the goals I documented:
    • Complete all tasks as assigned for HEDIS 2011
    • Submit HEDIS 2010 measures to NCQA
    • Complete any post-HEDIS analyses
    • Complete an internal leadership course
    • Coordinate two projects to completion
    • Complete another AHIP course
    • Complete another SAS course (advanced macros or programming 3)
    • Share SAS tools (e.g., macros, autoexecs) with other users
    Obviously, these goals were very tied to my previous position at the local health insurance company, Dean Health Plan. Since then, I have accepted a new position at a clinical practice organization, the UW Medical Foundation, so my goals had to change significantly. I'm still in the process of familiarization, but I have completed several projects already. So what should my goals look like? Here's an attempt at a revision:
    • Complete all tasks related to assigned quality-of-care measures for submission to Wisconsin Collaborative for Healthcare Quality (WCHQ)
    • Complete any ad-hoc analyses
    • Automate and update assigned production reports and processes (e.g., bulk emails)
    • SAS: Document setup; organize user group to share knowledge, processes, and macros; and implement security procedures for stored Oracle passwords
    • Provide support for other projects as needed
    • Familiarize with organization structure, including existing process/data/knowledge silos, and begin the communication process to reduce such silos
    I have already completed some of these goals, including a submission to WCHQ, ad-hoc requests, automating several reports/processes, and the SAS list. Next year, I should be sufficiently familiar with my position and the organization to have a more in-depth understanding of what I can help the organization with aside from my assigned duties.