LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2009, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 11 Feb 2009 12:57:51 -0500
Reply-To:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:   Re: INTNX with DAY interval?

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


Back to: Top of message | Previous page | Main SAS-L page