That surely is the problem. The macro is just doing text substitution. If you call it with ROW=ROW it will replace &ROW with ROW. But you want it to replace &ROW with a number. Since it is generating a PUT statement if you get the generated reference to the ROW dataset variable out of the quotes then the PUT statement will replace the name of the variable with the value.
... View more