It looks like your code is almost there. One thing to check: make sure your date comparison CDate(rngData(r, 1)) <= Date + 30 is correctly evaluating...
Consider using a third-party tool for straightforward XML conversion from your COBOL sequential file. Writing a COBOL program for this works too, but...