|
I need to calculate a figure which equates to the 'nearest' number of months between two dates. However the standard SAS function (INTCK) is not geared to consider the DAY of its date parameters (eg code below resolves to 0 when I need it to round to ...
Started by Bazil on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Z 8.; x="01APR08"d; y="28APR08"d; z=intck('MONTH',x,y); * wl is x + z months; wl=intnx('MONTH',x,z); * wu by the following:
data _null_; format x....
Data _null_; format x y date9.
You could use INTNX to see whether to round up or down, e.g.
|
|
On Mon, 31 Aug 2009 08:39:58 -0700 (PDT), drraju123 <drraju123@gmail.com
hi i want to calculate no of months between 2 dates as follows
ex: from date1 to date2
date 1 = 18jan2008
date 2 = 05mar2009
it will be 13 months + ((31-18)+5)/31;
that ...
Started by drraju123 on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at omgili):
Ref:
SAS Date, Time, and Datetime/lrdict/61724/HTML/default/a000245860....
*/
data
dte;fdosedt=13897;ldosedt=14233;
months=floor((intck('month',fdosedt,ldosedt)- (day can use the INTNX and DATDIF functions - and divide that by
31.
|
|
On Thu, 10 Sep 2009 23:29:39 -0700 (PDT), Michael <michaelnx@gmail.com
Hi,
Is there a way to write a function for the last friday of each month?
Thanks.
Mike
Started by Michael on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at omgili):
%macro LastFridayOfMonth(Year=);
data LastFridayOfAllMonths&Year.(keep = Date Month = intnx("MONTH","01JAN&Year."d, i, 'E');
interval = intck("WEEK.6", beg, end);
Date = intnx.
And
intck functions.
|
Ask your Facebook Friends