  In this manuscript we consider optimal control problems of stochastic
differential equations with delays in the state and in the control. First, we
prove an equivalent Markovian reformulation on Hilbert spaces of the state
equation. Then, using the dynamic programming approach for infinite-dimensional
systems, we prove that the value function is the unique viscosity solution of
the infinite-dimensional Hamilton-Jacobi-Bellman equation. We apply these
results to problems coming from economics: stochastic optimal advertising
problems and stochastic optimal investment problems with time-to-build.
