LET ch = base.Channel.create(filename,"w")CALL ch.setDelimiter("CSV")CALL ch.writeLine(heading_line1())CALL ch.writeLine(heading_line2())FOREACH data_curs INTO rec.* CALL ch.write(rec.*)END FOREACHCALL ch.writeLine(footer_line1())CALL ch.writeLine(footer_line2())CALL ch.close()