Package: sas2r 0.5.8

Songyue Chen

sas2r: Translate 'SAS' Programs to R with Dependency-Aware Migration

Translates 'SAS' programs and projects into R code, orders connected programs by their dependencies, and executes generated code. Compares generated datasets with supplied reference outputs and reports unresolved translation and validation findings. Rule-based translation works offline without a 'SAS' installation. Optional language model translation, review, and repair use a user-configured provider through 'ellmer' and may require an account and API credentials.

Authors:Songyue Chen [aut, cre]

sas2r_0.5.8.tar.gz
sas2r_0.5.8.zip(r-4.7-any)sas2r_0.5.8.zip(r-4.6-any)
sas2r_0.5.8.tar.gz(r-4.7-any)sas2r_0.5.8.tar.gz(r-4.6-any)
sas2r_0.5.8.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
sas2r/json (API)

# Install 'sas2r' in R:
install.packages('sas2r', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/songyue-chen/sas2r/issues

On CRAN:

Conda:

3.15 score 14 scripts 45 exports 35 dependencies

Last updated from:f12505b2f3. Checks:6 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK246
source / vignettesOK256
linux-releaseOK241
windows-develOK249
windows-releaseOK152
wasm-releaseOK110

Exports:analyze_output_orderapply_formatas_digest_jsonchr_cmpcompare_aligned_outputscompare_datasetscompare_profilediff_digestlib_deletelib_existslib_memberslib_readlib_writepassedqc_profileread_comparison_reportsas_codesas_compresssas_configsas_displaysas_if_elsesas_lengthsas_llmsas_llm_modelssas_llm_probesas_maxsas_meansas_mergesas_minsas_missingsas_preflightsas_putsas_roundsas_sortsas_substrsas_sumsas_translatesas_truesas_writesas2r_fold_namessas2r_libname_assignsas2r_libname_clearsas2r_resolve_registrysas2r_source_includewrite_comparison_report

Dependencies:bitbit64callrclicliprclueclustercpp11crayonfilelockforcatsgluehavenhmsjsonlitelifecyclemagrittrotelpillarpkgconfigprettyunitsprocessxprogresspsR6readrrlangtibbletidyselecttzdbutf8vctrsvroomwithryaml

Dependency-Aware SAS-to-R Migration
Overview | Migration Pipeline Architecture | Configuring a Clinical Study Migration (_sas2r.yml) | Inspect the setup offline | Declare a shared-session program order | Running a Migration in R | Four Canonical Bundle Statuses | Review completion and reference comparability | Component Evidence Ladder | Attempt Isolation & Copy-on-Write | Model Privacy & Clinical Data Protection | Parity Disclaimer

Last update: 2026-11-03
Started: 2026-11-03

The Runtime Inside Every Translated Program
What a bundle contains | Running a program | Maintaining autoexec.R | Using the runtime interactively | The reference | Versioning and stability | Where this is going

Last update: 2026-11-03
Started: 2026-11-03

Readme and manuals

Help Manual

Help pageTopics
Analyze dataset row order independently of content equivalenceanalyze_output_order
Apply a SAS formatapply_format sas_put
Serialize a diff digest to JSONas_digest_json
Compare values the way SAS doeschr_cmp
Compare aligned outputs under SAS-aware tolerance rulescompare_aligned_outputs
Compare two datasets under SAS-aware tolerance rulescompare_datasets
Build a comparison tolerance profilecompare_profile
Build the redacted diff digest (the only comparison artifact that may cross to an LLM). Names, counts, magnitudes, and enumerated hints only - never cell values, never key values.diff_digest
Delete explicitly named datasets from a writable librarylib_delete
Test whether a library dataset member existslib_exists
List ordinary dataset members in a configured librarylib_members
Read and write datasets through librefslib_read lib_write
Did a comparison pass within tolerance?passed
Print a sas2r translation summaryprint.sas2r_translation
Print a sas2r transpilation summaryprint.sas2r_transpilation
Define reusable dataset quality requirementsqc_profile
Read a bounded comparison report from the registryread_comparison_report
Retrieve staged code for a translated program from the selected bundlesas_code
SAS character functionssas_compress sas_length sas_substr
Load project configuration (optional by design)sas_config
Display values the way SAS prints themsas_display
IF/THEN/ELSE assignment with SAS semanticssas_if_else
Construct an LLM adapter from a project's llm: configurationsas_llm
List models visible to the configured provider identitysas_llm_models
Probe LLM connectivity and configured settings with a structured pingsas_llm_probe
Merge two datasets the way MERGE ... BY doessas_merge
Row-wise MIN and MAX with SAS missing semanticssas_max sas_min
SAS missing values and Boolean conditionssas_missing sas_true
Inspect a migration and optionally diagnose findingssas_preflight
Round the way SAS doessas_round
Sort a dataset the way PROC SORT doessas_sort
Row-wise SUM and MEAN with SAS missing semanticssas_mean sas_sum
Translate SAS programs or project to R with dependency-aware orchestrationsas_translate
Write translated code artifacts and outputs to a destination directorysas_write
Fold column names to lower casesas2r_fold_names
Bind or clear a libref at its point of usesas2r_libname_assign sas2r_libname_clear
Resolve a bundle's libref registry against its foldersas2r_resolve_registry
The runtime every translated program carries$<-.sas2r_dataset sas2r_helpers sas2r_runtime [[<-.sas2r_dataset
Run an included module where the %INCLUDE stoodsas2r_source_include
Write a PROC-COMPARE-style markdown report or versioned JSON comparison reportwrite_comparison_report