|
so that's what I say: it's not a good idea to do things the complicate
way, if there is also a simple solution! Also not for "self-documentation".
Why is it clear that in
new = intnx("day",old,1);
old and new are DATE values? And why is it not clear what I want, if I say:
new_date = old_date+1 ?
Ok, that makes it more complicate for non-SAS people to see what it is. So
for them you could do it in C-fashion:
%let one_day=1;
....
new_date = old_date+&one_day;
much clearer and faster than a function call.
By the way: I always use that for increasing a counter:
counter = 0;
counter = intnx("day",counter,1);
why is it clear, that COUNTER is a DATE-variable???
Gerhard
On Wed, 11 Feb 2009 12:41:14 -0500, Dianne Rhodes
<diannerhodes@COMCAST.NET> wrote:
>On Tue, 10 Feb 2009 13:16:20 -0800, Jack Hamilton <jfh@STANFORDALUMNI.ORG>
>wrote:
>
>>I was wondering if the compiler would optimize it out, but apparently
not:
>>
>>=====
>>58 data _null_;
>>59 do test_dt = '01jan1800'd to '31dec4000'd;
>>60 do i = 1 to 100;
>>61 next_dt = intnx('day', test_dt, 1);
>>62 end;
>>63 end;
>>64 run;
>>
>>NOTE: DATA statement used (Total process time):
>> real time 58.49 seconds
>> cpu time 57.68 seconds
>>
>>
>>65
>>66 data _null_;
>>67 do test_dt = '01jan1800'd to '31dec4000'd;
>>68 do i = 1 to 100;
>>69 next_dt = test_dt + 1;
>>70 end;
>>71 end;
>>72 run;
>>
>>NOTE: DATA statement used (Total process time):
>> real time 2.04 seconds
>> cpu time 2.01 seconds
>>=====
>>
>
>
>Thanks everyone for your feedback. I spoke with the developer and emailed
>him and he agreed to the changes. My other concern with the rename is
>that it passes the compiler now, but may trip an error in future releases
>of SAS. Maybe I should submit my paper on programming standards to NESUG.
>For what its worth, the developer is a consultant and I believe SAS
>certified.
>
>Dianne
|