## how to get a month from date variable in variable

Solved
Occasional Contributor
Posts: 13

# how to get a month from date variable in variable

Hello,

I want to know if i can get Month from date variable in a new variable.

Example -  I want to calculate 10% bonus on salary in the month of Hire Date.

Accepted Solutions
Highlighted
Solution
‎02-14-2018 11:01 AM
Super User
Posts: 9,427

## Re: how to get a month from date variable in variable

Show examples in the form of a datastep in future, I will guess what you have:

```data want;
mydate="01FEB2017"d;
month=month(mydate);
format mydate date9.
month monname3.;
run;```

All Replies
Highlighted
Solution
‎02-14-2018 11:01 AM
Super User
Posts: 9,427

## Re: how to get a month from date variable in variable

Show examples in the form of a datastep in future, I will guess what you have:

```data want;
mydate="01FEB2017"d;
month=month(mydate);
format mydate date9.
month monname3.;
run;```
Occasional Contributor
Posts: 13

## Re: how to get a month from date variable in variable

Thanks a lot,sure next time i will provide in detail.

Occasional Contributor
Posts: 13

## Re: how to get a month from date variable in variable

Thank you sure i will consider your suggestion.

☑ This topic is solved.

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

Discussion stats
• 3 replies
• 96 views
• 1 like
• 2 in conversation