SAS Notes

Compiled by : Wilson Suraweera @ CGHR
Contents
Random Numbers in SAS
Data Sub-setting
Selection  of  two Random Samples
Missing values replacement with Means of the respective Variables
Logistic Regression with SAS
SAS made easy using Proc SQL
SAS PROC SQL procedure to access external ODBC data sources
SAS String Data Handling
SAS Missing value arithmetic's
Text analysis - an Epedomiological Case Study by WS - SAS Institute HUG -01 April2011
Reading XPORT transport file into SAS 
External Resources
SAS Knowledge Base - Glossary of SAS Proceedures from SAS.com
Macro Seminar - UCLA
Logistic regression
          Some Interesting SAS SQL Examples
SAS Dinosaur - Old and New way of SAS progrming
Paul Dicman's Web Page for SAS- This little old discusses SAS 8, but useful
Global Statements Dictionary - Alphabatical listing and Description of SAS Key words
SAS Study Blog
         

 

Reading XPORT transport file into SAS 

Q.   What is the XPORT transport format, generally ?

A.   This is a popular extension that works fine with the SAS System and is supported by JMP, the SAS System Viewer,
     and soon will be supported by the UODBC driver.  Generally ".xpt" is the  XPORT filename extension.  
     It is a text file, with record length = 80 columns. It looks and feels so much like a text file 
     that it is a good idea to avoid using ".txt" as a file name extension so that the operating system won't 
     treat it as a text file.

	For details:  http://www.sas.com/industry/government/fda/faq.html  


Q.   How does  XPORT transport file read into SAS (9.1) ?

A.   This example uses the DATA step to restore a data set from a transport file.
	libname xportin xport '';
	libname target '';

	   data target.'transport-file name here' ;         /* If you want you can have a your own file name here */
   		set xportin.'transport-file name here' ;
	   run;


Example :  

Suppose file path of my  XPORT transport file name 'xpt_infile.xpt'  is  'C:\Wilson'
and target SAS dataset should be in the  'C:\Wilson\data', then SAS code will be

     libname xportin xport 'C:\Wilson\xpt_infile.xpt';
     libname target 'C:\Wilson\data';

     data target. xpt_infile ;
       set xportin. xpt_outfile;
     run;

Back to Top