DATA Step, Macro, Functions and more

How find first date of month whenever i run that code .

Accepted Solution Solved
Reply
Contributor
Posts: 34
Accepted Solution

How find first date of month whenever i run that code .

Need to find first date in month ..where as i don't have any date variable in table it's just take date value from system.

Accepted Solutions
Solution
‎12-16-2016 07:03 AM
Super User
Super User
Posts: 7,942

Re: How find first date of month whenever i run that code .

Um, the first date in any month is the 1st?  So:

data want;
  first_day_in_month=mdy(month(today(),1,year(today());
run;

View solution in original post


All Replies
Super User
Posts: 19,772

Re: How find first date of month whenever i run that code .

First = intnx('month', date(), 0,'b');

Solution
‎12-16-2016 07:03 AM
Super User
Super User
Posts: 7,942

Re: How find first date of month whenever i run that code .

Um, the first date in any month is the 1st?  So:

data want;
  first_day_in_month=mdy(month(today(),1,year(today());
run;
Contributor
Posts: 34

Re: How find first date of month whenever i run that code .

Thanks Mate !!!
☑ This topic is solved.

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

Discussion stats
  • 3 replies
  • 177 views
  • 1 like
  • 3 in conversation