Sheng Wang
Principal Data Scientist
View Bio PageFaster modernization, lower costs: Using agentic AI to transform legacy SAS processes into maintainable Python code
Agentic AI helped modernize a mission-critical HCUP production workflow while preserving the quality and reliability of trusted public data products
The Healthcare Cost and Utilization Project (HCUP), a flagship initiative of the Agency for Healthcare Research and Quality, was relying on legacy Statistical Analysis System (SAS) applications and SAS Dynamic Data Exchange (DDE)–based workflows to produce public-facing, Section 508-compliant tables. Although reliable, these processes required specialized SAS expertise and had become increasingly difficult to maintain. Mathematica sought a practical way to modernize this recurring workflow while preserving the sound business logic behind it.
Rather than translating the legacy SAS programs line by line, Mathematica used OpenAI Codex as an agentic artificial intelligence (AI) development assistant to recreate the production workflow from the underlying business rules and expected outputs. This approach generated modern, maintainable Python code without extending the client’s dependence on legacy technology.
Throughout development, Mathematica experts validated AI-generated outputs against the existing production process; refined prompts; and confirmed that the new workflow consistently produced the expected public-facing, Section 508-compliant tables. By combining agentic AI with expert oversight, the team accelerated modernization while maintaining confidence in the quality and reliability of the results.
Mathematica’s AI-assisted modernization improved development productivity while creating a more sustainable technology foundation for future HCUP production work. Specifically, our project:
Many public-sector organizations are struggling to preserve their trusted production processes while reducing their dependence on aging technology. This project shows that modernizing legacy systems does not mean sacrificing quality or institutional knowledge. By combining agentic AI with rigorous expert oversight, Mathematica accelerated modernization, reduced development costs, and created a more maintainable production workflow. The result offers a practical model for responsibly modernizing mission-critical public-sector data systems while enabling technical experts to focus on higher-value analytical and engineering work.
To solve their most pressing challenges, organizations turn to Mathematica for deeply integrated expertise. We bring together subject matter and policy experts, data scientists, methodologists, and technologists who work across topics and sectors to help our partners design, improve, and scale evidence-based solutions.
Work With Us