Document an undocumented SAS macro in plain language
AI reads a macro and drafts a header comment: purpose, parameters, inputs, outputs, side effects and known limits. The programmer verifies by running the macro; documentation that sounds right can be wrong.
Untested ideaLow risk
Evidence
Untested idea. Related PharmaSUG 2026 AI-305 uses LLM-written design documents from SAS code (its worked example was a macro), but did not test header documentation. Prompt not run.
Steps
- Paste the macro.
- Ask for a header block and parameter table.
- Test each parameter described.
- Correct and add examples.
- Store with version control.
Prompt
This is the prompt, typed out. No assistant reply is shown.
You
Document the SAS macro below. Produce: purpose in two sentences, parameter table (name, default, meaning, valid values), input datasets and required variables, output datasets and global macro variables created, side effects, and known limitations. Quote the code line for each claim. If behaviour is unclear, list under OPEN QUESTION. Do not guess.
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
- Every parameter description was tested.
- Defaults match the code.
- Side effects such as global variables are complete.
- Examples run.
- Stale or wrong statements are removed.
How it fails
Fluent documentation describes intended behaviour, not actual behaviour, including parameters that are ignored.
Data rule: No macros containing confidential logic, credentials or file paths. Strip identifiers first.