SAS to Python with parity
Move SAS programs to Python with evidence: inventory DATA steps, PROCs, PROC SQL and macros, map dataset lineage with a supported/partial/unsupported verdict per step, write a pandas draft that keeps SAS missing-value and sorting rules, and prove outputs match SAS within a declared tolerance. Use for SAS migration, modernization, SAS to pandas or Python, SAS lineage or reconciling SAS outputs, even if they don't say MCP.
At a glance
- Kind
- Skill · Ananke
skill - Reference
neo-pragnya-mcp/sas-to-python·ananke://skill/neo-pragnya-mcp/sas-to-python@1.0.0- Files
- 1 · 3.6 KB
- How it's used
- Skills load on demand: the agent sees this skill's name and description, and opens SKILL.md (and any bundled references or scripts) when a task matches.
Where it fits
- Task
- Refactor or modernise
- Domain
- Data
- Language
- PythonSQL
- Framework or tool
- MCP
- Platform
- Ananke PlexusClaude CodeGitHub Copilot
- Needs
- Nothing (text only)
Facets suggested from the item's own text and tags, not yet reviewed. Facets say where an item is relevant, not that it will run in your setup. How facets work
Checked by Dex
Verified, not self-reported: dex-trove 0.3.16 installed this item into each layout and checked that the tool can load it. Dex collects no download or usage data.
- Claude Code ✓ loads
- GitHub Copilot ✓ loads
Documentation
View upstream ↗This skill drives the dex-sas MCP server that ships with Dex Trove (dex mcp serve sas). The server runs
on your machine over stdio, uses only the Python standard library, and is dry-run by default: tools that change an
external system are refused unless the server was started with --allow-actions, and even then they need the
approval digest of the exact plan a person saw.
Set it up
uv tool install dex-trove # or: pipx install dex-trove
dex mcp config sas --client claude-code # prints: claude mcp add dex-sas -- uvx --from dex-trove==… dex mcp serve sas --root .
dex mcp config sas --client vscode # .vscode/mcp.json entry; also: codex, json
Add --allow-actions to the served command only in a session where actions are wanted.
No configuration. The draft needs pandas where it runs (not in Dex): uv run --with pandas python sas_draft.py --data in --out out.
Tools
| Tool | What it does |
|---|---|
sas_inventory | SAS steps, datasets read and written, macros, %let values, libnames and %includes, with lines. |
sas_lineage | Dataset-to-step lineage and a supported/partial/unsupported verdict for every step, with reasons. |
sas_draft | Writes a pandas draft that keeps SAS missing-value rules; untranslated steps stop the run. |
sas_parity | Compares a SAS output CSV with the draft’s output within a tolerance, by key or by position. |
How to use it
sas_inventory paths: steps with lines, datasets read and written, macros,%let, libnames,%include.sas_lineage: dataset-to-step edges, a Mermaid diagram and a verdict per step with reasons (SARIF for partial and unsupported).sas_draft output: a pandas draft. Every statement cites its SAS line; helpers keep SAS rules (missing is smallest,.=., SUM skips missing, half-away rounding, stable sort). Untranslated steps stop the run unless--skip-unsupported.- Export SAS outputs to CSV, run the draft on the same inputs, then
sas_parity expected actual keys abs_tol planfor each output.
Rules
- Never describe a partial or unsupported step as equivalent: show its reasons.
- Macros are quarantined: translate them by hand, then prove the result with parity.
- Declare the tolerance with the owner of the numbers before comparing.
- Credentials come from the environment only. Results, logs and evidence are redacted.
- Every result has the same envelope:
status,artifacts(with sha256),findings,warnings,provenanceand adigestthat ignores timestamps. Findings are also written as SARIF underdex-evidence/sas/, whereananke triage findingsreads them. - Every action, approved or refused, is appended to
.dex/mcp/audit.jsonl.
What has been verified
The generated draft runs on pandas 2 and pandas 3 and matches hand-derived SAS results for a representative program (DATA step with ELSE IF chains, DELETE, WHERE and missing values; SORT NODUPKEY; MEANS NWAY; FREQ). No comparison with output produced by SAS itself has been recorded yet.
From the shell, the same tools run once with dex mcp call sas <tool> --args '{...}'.