Hi, hope this question and description is easy to comprehend

I have gathered data for monthly returns for 49 industries from 2007 - 2018, as well as risk free rate (rf) and market returns, I wish to calculate a rolling beta for a 36 month window.

First issue:
The dates is formatted as 200701, 200702,...., 201812 with no days. How can I create a variable so stata recognizes it as months to create a window(36)

Second issue:
What would be the most reasonable code to use? I have been trying "rolling" but the the time variable seem to make it all messed up

Thank you in advance