create do,while loop in macro to add semicolon when calling also fix group stats