In addition to likely macro and datastep loop confusion you are referencing macro variables PT and PH with out any clue as to what they may look like. So a failure for your DO_Forme macro may fail because of values of those variables.
From what I see inside your macro there is no need for macro loop processsing.
You should run your macro with the system options MPRINT and SYMBOLGEN at least once. You may get some ideas of where the actual problem is as well as hints as to why you don't want the %do DTS to be a macro loop. Note that %do DTS creates a macro varaible. So all of your other references to DTS are a missing datastep variable. And any missing value + something will be missing.
... View more