DATA Step, Macro, Functions and more

Date by 15 Minute Interval

Accepted Solution Solved
Reply
Contributor
Posts: 33
Accepted Solution

Date by 15 Minute Interval

Hello all,

I'm still struggling with time in SAS.  I thought I had it down!  I'm trying to increment a date (SDate_Time) by a 15 minute interval.  I'm getting what I think is the right number of obs, but no Date_15.  What am I missing?

data gads6 (KEEP = SDate_Time NumIntervals);
set gads4;

do j = 1 to NumIntervals by 1;
  Date_15 = intnx('dtminute15', SDate_Time, NumIntervals);output;
end;

run;


Accepted Solutions
Solution
‎04-28-2015 02:40 PM
Trusted Advisor
Posts: 1,300

Re: Date by 15 Minute Interval

You have a keep data set option which is dropping Date_15.  There is nothing wrong with your intnx function call (beside the DT prefix being redundant)

View solution in original post


All Replies
Solution
‎04-28-2015 02:40 PM
Trusted Advisor
Posts: 1,300

Re: Date by 15 Minute Interval

You have a keep data set option which is dropping Date_15.  There is nothing wrong with your intnx function call (beside the DT prefix being redundant)

Contributor
Posts: 33

Re: Date by 15 Minute Interval

Doh!  OK I feel stupid now:-)  On the bright side I guess my date/time understanding is better.  Thanks!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 185 views
  • 0 likes
  • 2 in conversation