Re: st: Fwd: Converting weekly data of form yyyyww

-encode- is indifferent to the numeric or other meaning of the strings
it maps to numeric. That's a reason why -destring- is needed.

On your main problem, it seems that most weekly data come with one of
two definitions, that weeks start or finish on particular days of the
week. This is the key to successful data processing of weekly data. I
wrote a Stata Journal Tip on week assumptions in 2010. Google for the
reference or for Statalist posts that cite it. I intend to write more
on this, but probably not until after the Stata Conference in San
Diego starting tomorrow.

I get the result: (4 missing values generated) rather than the
correct

result.

I know that the 53-week year in 2009 is also going to pose a
problem,

but this problem persists even in the absence of week 53.
I have also attempted to split the string into components and build
the dates from these, but I receive the same problem, that missing
values are generated rather than the values themselves:
******************
inp str06 dates
201002
200953
201102
200935
end
gen year =substr(dates,1,4)
encode year, generate(nyear)
gen week = substr(dates,5,2)
encode week, generate(nweek)
gen delivery2 = yw(nyear,nweek)
*********************************