SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 46944: New SAS® transport format and tools available

DetailsCodeOutputDownloadsAboutRate It

The SAS® Version 5 (V5) transport file format is an open standard developed by SAS to support data transfers between systems, especially those running different operating systems. SAS has recently developed a new transport file format specification, along with three macros, that extends the older V5 transport file format and provides new capabilities. You can use the SAS® Universal Viewer 1.41 to read the V8 transport format by selecting File ► Open ► V5 Transport format from the menu.

The SAS V5 transport file is widely used in the biopharmaceutical industries. The availability of these new macros does not change the expectation that the FDA should receive clinical trial data in SAS V5 transport files.

The new SAS transport format and tools support the following:

  • Variable names can be up to 32 characters, and they are stored in their original case (upper or lower). The previously released transport file format only allows up to 8 characters.
  • Character variables can have lengths up to 32,767 bytes. The previously released transport file format only allows lengths up to 200 bytes.
  • Variable names can contain any characters other than null ('00'x). The previously released transport file format only allows alphanumeric and underscore as characters. Note that a variable name cannot be completely blank. Any variable name that contains characters other than alphanumeric or underscore would be represented in the SAS language as an n-literal (for example, 'a b'n). Starting in SAS® 9.3, using the VALIDMEMNAME=EXTEND option, variable names can contain embedded blanks and these additional characters:
       .~`!@#$%^&()_+={}[];', 
    
    These characters are allowed in the new transport file format, although you must be running SAS 9.3.
  • Variable labels can be up to 256 characters. The previously released transport file format only allows 40-character labels.

The macro LOC2XPT (from local session to xport) can identify whether the data set you are reading in has any extended data set features named above. For example, if the data set has long variable names, a new transport file is created. Otherwise, the older V5 transport file is made. You can specify the type of transport file that you want to create using the FORMAT= parameter. Here is a sample invocation of the LOC2XPT macro:

 %loc2xpt(libref=your_libref, memlist=dataset_name, filespec=your_filespec)

The macro XPT2LOC (from xport to local session) can convert older V5 transport files and the new transport file format. There are no restrictions regarding which version of SAS you are running in order to import the new transport file, as long as you are not running SAS Version 6. An example of calling the XPT2LOC macro follows:

 %xpt2loc(libref=your_libref,filespec=your_filespec)

The XPTCOMMN.SAS file contains common code used by both macros.

Using a file extension, you can differentiate between the transport file types. Any extension can be used, but we are using .v9xpt as the extension in the sample program because long format names exist, which is a new feature in SAS® 9. If you receive a file ending in .v9xpt and want to convert it to a SAS data set using %XPT2LOC (assuming that you have submitted the programs from the Downloads tab in your SAS session), you would simply use the following statement:

 

 %xpt2loc(libref=work, filespec='c:\trans.v9xpt') 
                or 
 %xpt2loc(libref=work, filespec=fileref) /* where fileref is unquoted */ 

The XPORT engine is restricted to reading the older V5 transport files. Revisions to XPT2LOC.SAS and XPTCOMMN.SAS macros in this Download tab, and in releases after SAS 9.4 TS1M3 within the autocall library, allow V5 and V6 transport files created with %LOC2XPT to be converted using PROC COPY and the XPORT engine. However, if you try to read a V8 or V9 transport file using PROC COPY and the XPORT engine, you will get an error in the log. The macro XPT2LOC reads both the older V5 transport files and the new V8 or V9 transport file format.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASHP-UX IPF9 TS M0
Linux9 TS M0
OpenVMS Alpha9 TS M0
Tru64 UNIX9 TS M0
64-bit Enabled Solaris9 TS M0
64-bit Enabled HP-UX9 TS M0
64-bit Enabled AIX9 TS M0
Microsoft Windows XP Professional9 TS M0
Microsoft Windows Server 2003 Standard Edition9 TS M0
Microsoft Windows Server 2003 Enterprise Edition9 TS M0
Microsoft Windows Server 2003 Datacenter Edition9 TS M0
Microsoft Windows NT Workstation9 TS M0
Microsoft Windows 2000 Professional9 TS M0
Microsoft Windows 2000 Server9 TS M0
Microsoft Windows 2000 Datacenter Server9 TS M0
Microsoft Windows 2000 Advanced Server9 TS M0
Microsoft Windows Server 2003 Enterprise 64-bit Edition9 TS M0
Microsoft Windows Server 2003 Datacenter 64-bit Edition9 TS M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9 TS M0
z/OS9 TS M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.