As a general advice do not nest macro definitions, but keep each macro definition separate
check whether the ODS ... FILE=...; some proc ODS ... CLOSE;
are placed correctly
Test the your macros with simple code first
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.