Get it from what? From a datetime value, you could use the intnx function.
data _null_;
dt = '03APR2017:01:04:34'dt;
fd = intnx('dtmonth', dt, 0, 'B');
ld = intnx('dtmonth', dt, 0, 'E');
put dt datetime. fd datetime. ld datetime.;
run;
Output:
03APR17:01:04:3401APR17:00:00:0030APR17:23:59:59
Or for the current datetime:
data _null_;
dt = datetime();
fd = intnx('dtmonth', dt, 0, 'B');
ld = intnx('dtmonth', dt, 0, 'E');
put dt datetime. fd datetime. ld datetime.;
run;
See also: INTNX and INTCK Function Examples.
... View more