Command Palette

Search for a command to run...

Назад к скиллам
скилл № 28107

convert-sas-to-snowflake

Preview. Convert SAS code to Snowflake SQL and stored procedures. Use for: DATA steps, PROC SQL, macros, PROC steps, EGP projects (extracted .sas files only)…

БесплатноБез исполняемых скриптов
sfc-gh-dflippoот sfc-gh-dflippo★ 35 звёзд на GitHub

Установить convert-sas-to-snowflake в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Convert SAS to Snowflake

© Snowflake Inc. This skill and its contents are the proprietary intellectual property of Snowflake Inc.

Expert SAS to Snowflake migration - ALWAYS outputs .sql by default, with PySpark/SCOS as last resort.

Output: .sql by default (Tier 1 SQL + Tier 2 Stored Procedures). PySpark/SCOS notebook = LAST RESORT (HASH objects, CALL EXECUTE, statistical procs only). See SQL-First Classification below for full tier tables.

Snowflake Interaction Policy: ALL Snowflake operations (object creation, compilation, testing) require explicit user confirmation. See workflows/steps-8-10-post-conversion.md for confirmation patterns and testing mode selection.

User Consent Propagation: When a user confirms a high-level decision (validation scope, compilation approval), downstream sub-decisions that are direct consequences auto-resolve without re-prompting. See "Consent Propagation Rules" section below.


Validation Prompt Policy (EXPLICIT — No Auto-Propagation)

Each validation phase requires its own explicit user confirmation. No phase auto-proceeds based on a prior selection. Snowflake operations ALWAYS show credit impact before executing.

Phase Prompt Credits Can Skip?
Phase 1: Synthetic Data Always runs (no prompt needed) Zero No
Phase 2: LLM Trace "Run LLM trace?" Zero Yes
Phase 3: Snowflake Compilation "Compile on Snowflake?" (with credit estimate) Minimal Yes
Phase 4: Snowflake Execution (Tier 2/3) "Execute on Snowflake?" (with credit estimate) Moderate Yes

Hard Artifact Gates: Each phase produces artifacts on disk. The NEXT phase CANNOT begin unless the prior phase's gate passes (artifacts verified to exist). State file updates without corresponding disk artifacts are INVALID.

Phase Required Artifacts
Phase 1 source_table_ddl.sql + synthetic_data.sql
Phase 2 tests/<file>/expected/expected_<table>.csv for each traced file
Phase 3 compilation_results.json with per-file pass/fail
Phase 4 snowflake_execution_results.json

Consent propagation is ONLY retained for:

  • Fix-and-retry loop within Phase 3 (auto-retry compilation fixes without re-prompting)
  • Auto-drop of temporary compilation environment after Phase 3 completes
  • These are sub-operations WITHIN a phase the user already approved

No batch-mode amplifier. Batch mode (10+ files) follows the same prompt rules as interactive mode.


Intent Detection

Start
  ↓
Analyze User Request
  ↓
  ├─→ Convert intent → Follow Conversion Workflow (below)
  │     (convert, migrate, translate, transform)
  │
  ├─→ Assess intent → Load ../assess-sas-migration/SKILL.md
  │     (assess, analyze, size, estimate, complexity, volume, LOE, readiness, heatmap)
  │
  └─→ Validate intent → Load validate-sas-conversion/SKILL.md
        (validate, verify, test conversion, check migration)

When to Use

  • Convert SAS DATA steps to Snowflake SQL or stored procedures
  • Translate PROC SQL to Snowflake SQL
  • Migrate SAS macros to Snowflake scripting
  • Convert PROC steps (SORT, MEANS, FREQ, TRANSPOSE, etc.)
  • Validate converted code against test data

Prerequisites

  • Active Snowflake connection (for validation)
  • Target schema exists (or user confirms schema)

SQL-First Classification

TIER 1: Pure SQL (Default - ALWAYS Try First)

Use SQL for:

SAS Pattern Snowflake SQL
PROC SQL Direct SQL (strip PROC SQL/QUIT)
PROC SORT ORDER BY or QUALIFY ROW_NUMBER() for NODUPKEY
Simple DATA step (SET, WHERE, IF≤3) CREATE TABLE AS SELECT
PROC FREQ GROUP BY with COUNT(*)
PROC MEANS (no OUTPUT) Aggregate functions (AVG, SUM, etc.)
MERGE with simple BY JOIN
FIRST./LAST. flags Window functions: ROW_NUMBER(), LEAD/LAG
RETAIN (running totals) SUM() OVER (ROWS UNBOUNDED PRECEDING)
Simple ARRAY (same operation) GREATEST(), LEAST(), COALESCE()

TIER 2: Stored Procedures (When Pure SQL Insufficient)

Use Snowflake Scripting when:

Pattern Detection Why Stored Procedure
RETAIN with conditional reset retain + if first. + reset logic State management across rows
FIRST./LAST. with complex calc first. + accumulator + last. output Multi-step BY-group logic
Multiple OUTPUT datasets output table1; output table2; Conditional routing
>5 IF/WHEN branches in a DATA step DATA-step SELECT/WHEN or IF/THEN (not PROC SQL CASE WHEN) Complex business logic
Row-by-row state changes Previous row affects current Cursor-like processing
Iterative calculations Values build on prior iterations Sequential dependency

Stored Procedure Pattern:

CREATE OR REPLACE PROCEDURE process_sas_logic(p_input STRING, p_output STRING)
RETURNS STR
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/auto-validation.md
  • references/batch-mode.md
  • references/checkpoint-logging.md
  • references/classification-logic.md
  • references/common-patterns.md
  • references/comparison-rules.md
  • references/consolidation-patterns.md
  • references/conversion-rules.md
  • references/data-steps.md
  • references/e2e-orchestration-test.md
  • references/function-mappings.md
  • references/large-file-rules.md
  • references/macros.md
  • references/mermaid-diagrams.md
  • references/multi-block-orchestration.md
  • references/proc-sql.md
  • references/proc-steps.md
  • references/pyspark-fallback.md
  • references/python-datascience.md
  • references/schema-inference.md
  • references/snowflake-compile.md
  • references/snowflake-execution.md
  • references/state-tracker-schema.md
  • references/synthetic-data-rules.md
  • references/validation-execution.md
  • references/vendor-function-mappings.md
  • references/vendor-passthrough.md
  • templates/consolidation-report.md
  • templates/conversion-report.md
  • templates/output-mixed.md
  • templates/output-sql.md
  • validate-sas-conversion/SKILL.md
  • workflows/steps-7-validation.md
  • workflows/steps-8-10-post-conversion.md
  • workflows/validation-pipeline.md

FAQ

Что делает скилл convert-sas-to-snowflake?

Preview. Convert SAS code to Snowflake SQL and stored procedures. Use for: DATA steps, PROC SQL, macros, PROC steps, EGP projects (extracted .sas files only). Triggers: convert SAS, migrate SAS, SAS to Snowflake, translate SAS code, SAS migration, SAS analysis, SAS dependency diagram, validate SAS conversion. Note: For .egp files, extract the embedded .sas code first using SAS Enterprise Guide export.

Как установить скилл convert-sas-to-snowflake?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл convert-sas-to-snowflake запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить convert-sas-to-snowflake с