journal
all all entries rss SoML excited dreams runes YRUU ultimate KTRU skate sleepy nihongo
Rob is 20,139 days old today.
prev day next day printable version

Entries this day: Paul kevin

Paul

1:15pm CDT Wednesday 24 April 2002

Just went to lunch with Dude at MB. He bought mine (cheap 2 for 1 today with coupon!) and I gave him my excess pounds and euros from European adventure.

On the way back, an old man in a wheelchair slightly waved to me. I saw he was working on what appeared to be a model airplane.

Turned around and met him. Name is Paul - he's invented a coffee machine, a type of grader to fit on a bobcat tractor thing, and has built fifty-some different model airplanes. He's invented more I'm sure, but I didn't stay very long. He invited me over sometime; I may do that.

permalink

kevin

5:07pm CDT Wednesday 24 April 2002

Kevin is pretty amazing. He's my technical-oriented boss, (as opposed to Karla - I guess she would be my business-oriented boss) and has been working with SAS for several years (15).

So anyway, I love the way he can use quirks of SAS to solve problems that I see as impossible. Here is the latest example:

%if %qsubstr(&&&use_var,1,4) = VARS %then %do...

Obviously this will cause a WARNING if the length of the value of the variable name stored in use_var (&&& = 2 levels of indirection in SAS) is less than 4.

How to solve this? Determine the length of the thing and not hardcode 4, right? Well yes, but(!) in the context where this code exists, I cannot use any other data steps to determine the length of the value, and there are no macro functions to do it.

I was stuck.

But Kevin found a brilliant way to solve it, which amounts to artificially lengthening the value at the point of the comparison (but not changing its actual value):

%if %qsubstr(&&&use_var..xxxx,1,4) = VARS %then %do...

The two dots terminate the macro variable name, and the macro variable name it resolves to. Then the xxxx is appended to that value at the moment of the substring comparison. Perfect.

permalink
prev day next day