User Guide : Map Connectors : Source and Target Map Connectors : SAS Transport Format
 
Share this page             
SAS Transport Format
With this connector, the integration platform reads and writes SAS transport data sets for mainframe and PC SAS versions 5 and later. Because the procedures are slightly different for version 5.x and 6.x and higher, the procedure section is divided into two sections, each specific to the import and export commands. Refer to the SAS documentation for specific information about your version of SAS.
ODBC and SAS
SAS data can also be read and written easily using ODBC drivers. For details, see ODBC 3.x.
SAS Versions 7.x and 8.x
The integration platform SAS connector supports the ability to create Transport Data Sets using PROC COPY only (this includes all SAS versions, including the newest 7.x and 8.x). The integration platform does not support the use of CPORT. You MUST use PROC COPY to create the SAS Transport Data Sets.
SAS versions 7.x and 8.x also include the ability to read/write other intermediate file formats, such as dBASE, Excel and others.
Large File Support
Since an enhancement was made to this connector, the integration platform can now handle large files (2 gigabytes and larger), with no maximum file size limitation.
Connectivity Pointers
To connect to SAS Transport Format v5 as your source
1. Log on to SAS.
2. In the program editor at the bottom of the screen, type the following commands starting on line 1:
libname XXX sasv5xpt 'c:\path\file.ext;
proc copy in=work out=XXX;
select YYY; run;
Where XXX is any library where you want a copy of the data set. YYY is the name of the data set you want to transport. (It must exist in the work library. If it is in another library, change in=work to in=name of the library it is in.)
Where c:\path\file.ext is the drive, directory path and file name of the transport file you want SAS to create. If you do not specify a path, it creates it in the current directory.
3. At the command line, type submit and press Enter.
4. After you create the transport data set, open the integration platform.
5. Create a new data set.
6. In the File box, select the file 'c:\path\file.ext' that you created in SAS.
7. At Member, click the arrow to select a member and click OK.
To connect to SAS Transport Format v5 as your target
1. Create a target data set in the integration platform with SAS as your target connector and 'c:\path\file.ext' as your target file. Enter a name for the table.
2. Log on to SAS.
3. In the program editor at the bottom of the screen, enter the following commands starting on line 1:
libname XXX sasv5xpt 'c:\path\file.ext;
proc copy in=XXX out=work;
proc print; run;
Where XXX is any library where you want a copy of the data set. 'c:\path\file.ext' is the drive, directory path and file name of the transport file you created with the integration platform. If you do not specify a path, SAS looks in the current directory.
4. At the command line, type submitand press Enter.
Now you have a dataset called 'work.XXX' available in your SAS session.
Note:  If you are using SAS version 8, you must use PROC COPY rather than the CPORT method of creating the SAS Transport data sets. The integration platform does not support CPORT. But, as SAS version 8 still supports the use of PROC COPY, you should experience no problems using the following procedure whether you are using version 6 or version 8.
To connect to SAS Transport Format v6.x and later as your source
1. Log on to SAS.
2. In the program editor at the bottom of the screen, type the following commands starting on line 1:
libname XXX XPORT 'c:\path\file.ext'
proc copy in=work out=XXX
select YYY; run;
Where XXX is any library where you want a copy of the data set. YYY is the name of the data set you want to transport. (It must exist in the work library. If it is in another library, change in=work to in=name of the library it is in.)
Where c:\path\file.ext is the drive, directory path and file name of the transport file you want SAS to create. If you do not specify a path, it creates it in the current directory.
Note:  For VAX/VMS version 6.08+, you must include the option CC=NONE; at the end of the LIB statement. For versions prior to 6.08, the file must be modified by removing the CR-LF's. (Refer to your SAS documentation for details.)
3. At the command line, type submit and press Enter.
4. After the transport data set has been created, start the integration platform.
5. Create a source data set and select SAS as the connector. In the file list, select the file path name that you created in SAS. Select a table from the list.
To connect to SAS Transport Format v6.x and later as your target
1. Create a target data set and select SAS as your target connector and 'C:\path\file.ext' as your target file. Type a name for the table.
2. Log on to SAS.
3. In the program editor at the bottom of the screen, type the following commands starting on line 1:
libname XXX XPORT 'c:\path\file.ext'
proc copy in=XXX out=work;
proc print; run;
Where XXX is any library where you want a copy of the data set. 'C:\path\file.ext' is the drive, directory path and file name of the transport file you created with the integration platform. If you do not specify a path, SAS looks in the current directory.
4. At the command line, type submit and press Enter. Now you have a data set called 'work.XXX' available in your SAS session.
Connector-Specific Notes
This connector does not support truncation error trapping. If the target field size is too small for the data written to it, the offending record may be skipped or incomplete data may be written to the target. The transformation does not stop due to a truncation error, as do connectors that have truncation support. You may instead use ODBC as your connector to trap truncation errors.
Property Options
You can set the following source (S) and target (T) properties.
Property
ST
Description
ScanTables
ST
Sets whether you want to scan the entire file for multiple tables or sets of data. Default is true. If you have a particularly large file, or a file with many tables and you wish to save scan time, you should set this option to false.
CodePage
ST
Sets the translation table for the encoding to use to read and write data. Default is ANSI.
Special Notes about SAS Dates
To convert SAS date strings into valid date formats for other database applications, use the following target field expression:
DateAdd("d", Fields("FIELDNAME"), DateValue("01/01/60"))
where ("FIELDNAME") is the source field name in the SAS source file. The remainder of the expression should be written exactly as shown above.
Note:  The SAS date field is read as a Text data type. You must manually change the data type to Date.
Data Types
The following data types are available:
Date
DateTime
Text
Variable length IBM float