Try this modification (untested):

Code:
...
  if(index = 0) then
    PRINT
    PRINT "DW ";
  else
    if(index MOD 34 = 0) then 'this dictates how many values per line
      PRINT " " 'this puts no comma at the end of the line
      PRINT "DW ";
    else
...
Robert