SAS Xpt file Import

SAS day 50:


Sometimes, we need to transfer some .xpt file to .sas7bat datasets for an old study.  While other times we need to convert .sas7bat data to .xpt format for FDA define submission.

So Today we will go over the procedure to Convert the .xpt and .sas7bat files.

Blood Key : access=READONLY

ArtTower / Pixabay

Thanks sruthi for sharing the code.
Note: xport statement needs to specify a dataset, not a whole folder.  

  • Convert .xpt file to .sas7bat data

libname sasfile "c:/....";
libname xptfile xport 'c:/...../adsl.xpt' access=readonly;
proc copy inlib=xptfile outlib=sasfile;



  • Convert .sas7bat file to .xpt file
LIBNAME mod "/C/data/final";
LIBNAME sasxpt XPORT '/C/final/xpt/adae.xpt';
PROC COPY IN=mod OUT=sasxpt;
SELECT adae;

Note : don’t use cimport!!!! 

Happy coding !

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Social media & sharing icons powered by UltimatelySocial
%d bloggers like this: