We provide a dynamic programming principle for stochastic optimal control
problems with expectation constraints. A weak formulation, using test functions
and a probabilistic relaxation of the constraint, avoids restrictions related
to a measurable selection but still implies the Hamilton-Jacobi-Bellman
equation in the viscosity sense. We treat open state constraints as a special
case of expectation constraints and prove a comparison theorem to obtain the
equation for closed state constraints.
Motivated by applications to bond markets, we propose a multivariate
framework for discrete time financial markets with proportional transaction
costs and a countable infinite number of tradable assets. We show that the
no-arbitrage of second kind property (NA2 in short), introduced by \cite{ras09}
for finite dimensional markets, allows to provide a closure property for the
set of attainable claims in a very natural way, under a suitable efficient
friction condition.