You can certainly do this in a SAS SQL passthru query. You can run normal SAS code including SAS SQL in SAS VA using SAS Studio which comes bundled in a VA (7.x) installation. You would however need SAS/ACCESS to SQL Server or ODBC installed on your VA platform.
Catch up on SAS Innovate 2026
Nearly 200 sessions are now available on demand in the Innovate Hub.