A little announcement. A lot to explore.

Happy learning!

Explore lessons, including SAS & R programs and practice data.

Search lessons

Type at least 3 characters to see matching lessons.

Open SAS ↗Open R ↗
← SASnRWrite SAS Transport Files (.xpt)

Introduction

  • FDA regulatory submissions require datasets in SAS V5 transport format (.xpt) — this is often the very last step in a clinical programming workflow.
  • Both SAS and R can produce compliant .xpt files, so the choice of environment does not affect the submission.
  • Key constraints to check before writing: variable names must be 8 characters or fewer, and variable labels must be 200 characters or fewer.
  • SAS uses LIBNAME XPORT with PROC COPY; R uses haven::write_xpt() with version = 5.
  • After writing, we verify the .xpt file by reading it back in and confirming that labels, types and row counts are intact.

Write SAS Transport Files (.xpt)