Register Converted SAS SQL into the Code Unit Registry
© Snowflake Inc. This skill and its contents are the proprietary intellectual property of Snowflake Inc.
Purpose: The second of two registration steps. After register-sas-source-units
has written source-side CUR entries, this attaches each converted .sql file
(files.converted), confirms the objectType from the generated SQL, and stamps
codeStatus.conversion — so scai test seed/validate can run against the SAS
conversion in Snowflake self-consistency mode.
Boundary (do not cross): Writes/updates registry/<id>.json only. No
SnowConvert dialect, no .NET CodeUnitRegistry engine, no MCP state machines,
no AIM claims/waves. See ../INTEGRATION.md; contract in ../references/cur-schema.md.
When to use
- After a SAS conversion has produced
.sqloutput and itsconversion_state.jsonmarks filescomplete. - Invoked automatically by
convert-sas-to-snowflakepost-conversion, or run standalone.
Inputs
- Project root — the SAS conversion
<output_dir>(already registered byregister-sas-source-units). - conversion_state.json (optional path) — defaults to
<project-root>/conversion_state.json. Supplies, per file:output_file(the converted.sql),tier, anddependencies.
Workflow
Ensure source units exist. If
registry/is empty, runregister-sas-source-unitsfirst (this pass updates existing entries; it does not create them).Run the emitter:
cd ../assess-sas-migration/tool python3 emit_cur.py converted \ --project-root <output_dir> \ --state <path/to/conversion_state.json>For each file with
status == "complete"(and not a3-PYSPARKtier), it:- locates
output_file, copies it undersnowflake/, md5-checksums it, and setsfiles.converted.path(root-relative); - reads the converted SQL and sets the authoritative
objectTypefromCREATE [OR REPLACE] PROCEDURE|FUNCTION|TABLE|VIEW(falling back to the tier mapping if the pattern is absent); - fills
target.database/target.schemafrommetadata.target_schema; - stamps
codeStatus.conversion.status = "completed".
- locates
Report attached counts and which units are now
procedure/function(seedable) vstable/view(registered but not proc-tested).Run the harness (self-consistency): see
../convert-sas-to-snowflake/workflows/scai-test-selfconsistency.md. In short:scai test seed --where "source.platform = 'sas'"thenscai test validateagainst Snowflake. Note:scai test capturefrom a source system is not applicable to SAS — the baseline is the converted code's own stable Snowflake run (or the convert skill's validation expected-outputs).
Notes
- Idempotent. Re-running re-attaches to the same UUIDv5 units.
- Units whose source was never registered are skipped without error (run Skill A first). PySpark (Tier 3) units remain source-only — they are not SQL objects.