Some structured dynamic programs arising in economics