Sending SPSS and SAS System Files Over the Internet

By Dr. Panu Sittiwong, Research and Statistical Support Manager (panu@unt.edu)

This article appeared in the March/April 1994 issue of Benchmarks and is reprinted here mostly to make this issue on electronic data transfer truly comprehensive. The last paragraph, however, has been added since the article was first published.

The extensive availability of the Internet network and its speed in transferring files from one site to another makes it possible to send data files over the network. Raw data files can be sent easily without much preparation. System specific data files such as those that were created by SAS and SPSS require some preprocessing before they can be sent. This article will outline the steps that are required if you want to send those datasets through the Internet.

Since both SAS and SPSS system data files were created to be used only on the same operating system on which they were created, they are not useful on other systems. In order to move these datasets to another operating system, you will need to copy the data into a transport or export format. The export format data file contains instructions which are understood by all computer operating systems on how to create the attached data file into the system file for that particular operating system.

At UNT, SAS software is available for DOS, Windows, OS/2, UNIX, CMS, and the OS/MVS operating environments. The following programs show the SAS statements that will create an export data format.

SAS/PC

 Libname PORT SASV5XPT 'd:\filename.ext';*d:\filename.ext is a DOS filename
  including Drive name and directory name;
 Libname SASPCFIL 'd:\path';*d:\path is a drivename and directory name;
 Proc Copy in=SASPCFIL out=PORT;
    Select filename;*filename is a DOS filename which contains a
  SAS dataset that you want to copy to export
  format;
 

SAS for UNIX, Windows, and OS/2.

 Libname PORT XPORT  'd:\filename.ext';*d:\filename.ext is a filename including Drive
  name and directory name;
 Libname SASPCFIL 'd:\path';*d:\path is a directory name;

 Proc Copy in=SASPCFIL out=PORT;
    Select filename;*filename is a DOS filename which contains 
 the SAS dataset that you want to copy to 
 export format;

SAS for MVS

//idnnSAS JOB (idnn,2,10,9999),'Your Name',PASSWORD=mvssp
/*JOBPARM CARDS=99999
//    EXEC    SAS
//PORTDDSYSOUT=B
Libname SASFILE 'USER.idnn.xxxxxxxx' UNIT=SYSDA VOL=SER=ACADnn DISP=SHR;
Libname PORT XPORT;
Proc Copy in=SASFILE out=PORT;
  Select name
 
Where: USER.idnn.xxxxxxxx is MVS Dataset name.
ACADnn is a DASD volume name.
name is a SAS member name.
 

After the job is done, you can copy the export file to your minidisk from the J2 Browse screen.

SAS for CMS

 Libname PORT XPORT 'filename filetype filemode';
 Libname SASFILE 'A';
 Proc copy in=SASFILE out=PORT;
   select name;

SPSS/PC+

Get file =  'd:\filename.ext'.
 Export outfile =  'd:\filename.ext'.*d:\path is a drive name and a directory name;
 
 Where:d:\filename.ext is a DOS filename including drive name and directory name.
 

SPSS for MVS

 
//idnnSAS JOB (idnn,2,10,9999),'Your Name',PASSWORD=mvssp
/*JOBPARM CARDS=99999
//    EXEC    SPSSX
//SPSSFILEDDDSN=USER.idnn.xxxxxxxx,UNIT=SYSDA,
VOL=SER=ACADnn,DISP=SHR
//PORTDDSYSOUT=B
 Get file = SPSSFILE
 Export outfile = PORT
 
Where:USER.idnn.xxxxxxxx is an MVS Dataset name.
ACADnn is a DASD volume name.

SPSS for CMS

Get file =  'filename filetype *'.
 Export outfile = 'filename filetype filemode'.
 

Step-by-Step Process

  1. Create and run the appropriate program above.
  2. The program will create an export datafile. In PC, CMS, and UNIX environments, the file will be named whatever you specify. In the MVS environment, the file will be in punch format. You can copy this file from the J2 queue to your minidisk with the command COPY filename filetype filemode.
  3. You can send this file on the Internet using any mail program. When using the CMS operating system, however, you must transfer this file using the SENDFILE command. This command must be issued after the TCPIP command.
  4. You can transfer this file using the FTP program also. SPSS export files may be sent as a regular text file (ASCII mode). SAS export files, however, must be transferred using binary mode. To do this, type BINARY F 80 below the Get or Put command. This will preserve the 80 column LRECL of the export file.

If you have problems or questions about this server, please contact us as soon as possible. You can send mail to the following address:

WWW@unt.edu