AI remains the biggest buzz in 2026 and there’s no way we can turn our backs on it. The best way to tackle AI is to adapt to AI and make it a part of our daily corporate tasks. Right from emails to documentation to even SAS Programming, I believe that AI is here as an assistant, augmenter and accelerator to improve the way we work.
As a part of my trainer role, I work with many young students who have knowledge of some programming language which they learnt in their schools. I also work with experienced programmers who’ve been coding for years. Copilot is going to change / already changing the way programmers do coding.
Disclaimer: Though I have used Copilot as an example in this article, please feel free to read it as ChatGPT, Claude or any other AI system.
Based on my experience of coding and working with coders so far, here are my 2 cents on what works and what doesn’t when you use Copilot to help you with SAS Programming especially when you’re a new SAS programmer who’ve less than 1 year of coding knowledge.
What Works
Learning SAS Syntax
SAS Programming has a very rich set of functions, formats, procedures and statements. A new programmer might feel like drowning in the jargon ocean. Copilot is a great support in this scenario.
Understanding syntax becomes easier and new programmers can focus on building logic than memorizing syntax!
Example of Copilot prompt and partial results:

Taking over coding done by ex-colleague
Understanding coding done by someone else can be mindboggling. Copilot to the rescue! It can be used to simplify and understand existing coding which otherwise will take long time if you’ve to do it all by yourself.
Example of Copilot prompt and partial results:


Getting your problem statement converted into SAS Code
When the timelines are tight and you’ve to churn out quick reports as a new programmer, things can get overwhelming. Copilot works excellently in such scenarios in my experience.
Example of Copilot prompt and partial results:


Comparing this vs. that
Many times, I have personally used Copilot to understand differences between similar-natured functions or concepts. Examples will be – Scan vs Substr, Compute Server vs CAS, Data Step vs. Proc SQL and so on.
Copilot summarizes in bullet points, and you can also save the results as a PDF ready reckoner.
Example of Copilot prompt and partial results:

What Doesn’t Work
Using Copilot as a SAS Programmer
Well, if you think that your entire coding workload can be handled by Copilot, probably you’re on the wrong track. Code generated by Copilot is not guaranteed to be 100% correct whether syntax or logic. Also, it might not be designed for efficiency in performance.
So, caution needs to be maintained when it comes to relying on Copilot code. Copy-paste approach is quite dangerous. You still have to thoroughly test and edit the code as necessary to suit your use case.
Traditional SAS code vs. CAS-compliant code
Copilot is prone to goof up when it comes to generating CAS-compliant code. It doesn’t well-differentiate between SAS library vs. CAS library or single-threaded vs. multi-threaded options unless you specify very very explicitly.
Example of Copilot prompt and partial results and what’s potentially wrong with the results:
Prompt:

Results:

Copilot suggested the code in PROC FEDSQL instead of a Data Step. Also note that the tables are in the work and pvbase libraries, which are not CAS libraries.
Complex Data step programming or Macro coding
Copilot is known to struggle with SAS code when it comes to Macro quoting functions or excessive use of Proc SQL where Data step is simpler or vice-versa or assumptions like data is sorted even when it’s not. Copilot also might “hallucinate” and suggest non-existent proc options or CAS actions and so on.
We all need to note here that Copilot and other AI systems are updated and refined through successive model releases. This will lead to improvements and refinements in accuracy and consistency of results.
Example of Copilot prompt and partial results and what’s potentially wrong with the results:

Copilot is indeed valuable aid for new programmers but only when it’s coupled with programmer’s own intelligence, diligence and evaluation of Copilot-generated SAS code.