DATA Step, Macro, Functions and more

plz cnvrt into days

Reply
Contributor
Posts: 34

plz cnvrt into days

data _null_;
td=today();
*td='18jul2014'd;

bgn_date=intnx('month',td,0,'b');
end_date=intnx('month',bgn_date,0,'e');
prev2mth=intnx('month',td,-2,'s');
call symput('As_of_dte',put(td,yymmdd8.));
call symput('As_of_dt',put(td,yymmdd10.));
call symput('As_of_dte1',put(td-1,yymmdd8.));
call symput('month_begin',put(bgn_dte,yymmdd10.));
call symput('month_end',put(end_dte,yymmdd10.));
call symput('month_stamp',put(bgn_date,yymmn6.));
call symput('prev2mth',put(prev2mth,yymmddn8.));
run;

Super User
Super User
Posts: 7,413

Re: plz cnvrt into days

Hi,

Sorry, am not following.  Please provide test data, as a datastep, and required output.

Super User
Posts: 10,533

Re: plz cnvrt into days

Note: All SAS date values are days since 1 Jan 1960. So they are already "days".

You can get day of the month with the DAY function.

You can get day of the year using Juldate and Mod functions.

Ask a Question
Discussion stats
  • 2 replies
  • 151 views
  • 0 likes
  • 3 in conversation