SAS code analysis and extraction. Use when config.source.type is "sas". Parses SAS programs, DATA steps, PROC steps, and maps to target platform equivalents (PySpark, SQL).
This skill is planned but not yet fully implemented. The structure below describes the intended capabilities.
Load this skill when the migration config specifies:
{
"source": {
"type": "sas"
}
}
Parse SAS programs to extract:
Map SAS DATA step operations to target equivalents:
| SAS DATA Step | Target Equivalent |
|---|---|
SET | Read DataFrame |
MERGE | DataFrame join |
IF-THEN-ELSE | when/otherwise |
DO-END | Loop logic |
OUTPUT | Write row |
RETAIN | Window function |
ARRAY | Array operations |
BY | Group operations |
WHERE | filter |
KEEP/DROP | select columns |
Map SAS PROCs to target equivalents:
| SAS PROC | Target Equivalent |
|---|---|
PROC SQL | Spark SQL |
PROC SORT | orderBy |
PROC MEANS | groupBy + agg |
PROC FREQ | groupBy + count |
PROC TRANSPOSE | pivot |
PROC APPEND | union |
PROC DATASETS | Table operations |
Parse and expand SAS macros:
%MACRO definitions%LET variables%DO loops# Parse SAS program
python scripts/parse_sas.py --file "program.sas"
# Extract DATA steps
python scripts/extract_data_steps.py --file "program.sas"
# Translate to PySpark
python scripts/translate_to_pyspark.py --file "program.sas"
/* Library references */
LIBNAME mylib '/path/to/data';
/* DATA step */
DATA output_table;
SET input_table;
WHERE status = 'ACTIVE';
new_col = old_col * 2;
RUN;
/* PROC step */
PROC SQL;
CREATE TABLE result AS
SELECT * FROM table1 a
LEFT JOIN table2 b ON a.id = b.id;
QUIT;
To implement this skill: