clear
input num
200306
200309
200312
200403
200406
200409
end
todate(num), gen(ym) p(yyyymm) f(%tmMonCCYY) //you first have to find and install "todate"
gen yq=qofd(dofm(ym))
format yq %tq
According to the original post, 200306, 200309 ... are actually year-month data. That's why I have to use p(yyyymm). Then I converted it to year-quarter data using function "qofd".
If you type "help dates" in Stata, you'll find you can format year-month data in several ways, %tmMonCCYY is one way. You can simply use %tm.