StatAgentWeekly email

Translate long SAS programs in chunks and watch for silently skipped sections

Practitioners report that ChatGPT handles short, straightforward SAS well but may omit or skip long or complex sections. Splitting programs into pieces and checking coverage is their recommended practice.

Reported in literatureHigh risk

Task
Programming
Roles
Programmer
Assistants
Microsoft 365 Copilot, ChatGPT, Claude
Last reviewed

Evidence

Reported in literature. PharmaSUG 2025 AI-242 (Bosak and Varney) is an experience paper using ChatGPT o3-mini-high. The authors say it does well on code of about 200 lines or less, sometimes gives up on or skips long or tricky sections, can still make up functions, and answers inconsistently. Their demonstration was a very short program. No measured error rates.

Steps

  1. Split the program into logical steps.
  2. Translate each chunk separately.
  3. List any comment saying code was not translated.
  4. Reassemble and run.
  5. Compare with SAS output.

Prompt

This is the prompt, typed out. No assistant reply is shown.

You
Translate this SAS section to R. After the code, list every SAS statement or macro call that you did not translate or changed, with the reason. Do not skip any statement silently. Section is part of a larger program; state any variables you assumed from earlier sections as OPEN QUESTION. Rules: use ONLY the input below. Tag anything the input does not state as OPEN QUESTION. Never invent numbers; use placeholders such as xx. Do not claim anything is verified. INPUT: [paste input here]

Verify before you use it

How it fails

AI leaves out or stubs tricky sections, and the program still runs.

Data rule: No production code with confidential logic or study identifiers. Use public or simulated programs.

Sources

Related

How we check. Back to the directory.