Sample 25109: PROC COPY (TRANSPORTING) sample programs
Selected SAS data sets are written to a transport file. Generic syntax for creating and reading the transport file is given followed by operating system specific syntax for creating transport files on tape in the following environments:
MVS, CMS, VMS, and UNIX. For MVS customers, importing from tape to disk is also shown.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
/* Example 1: create a transport file - generic example */
LIBNAME TRAN XPORT 'transport-file-name';
LIBNAME OLD 'library-name';
PROC COPY IN=OLD OUT=TRAN MEMTYPE=DATA;
SELECT TEST1 TEST2 TEST3;
RUN;
/* Example 2: read a transport file - generic example */
LIBNAME TRAN XPORT 'transport-file-name';
LIBNAME NEW 'library-name';
PROC COPY IN=TRAN OUT=NEW;
RUN;
/* Example 3: MVS tape example - create a transport file */
//EXAMP1 JOB (,X101),'SMITH,B.',TIME=(0,5)
// EXEC SAS606
//TRAN DD DISP=NEW,UNIT=TAPE,
// VOL=SER=TRAN01,LABEL=(1,NL),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000,DEN=6250)
//SYSIN DD *
libname old 'actxyz.sales91.sasdata';
libname tran xport;
proc copy in=old out=tran memtype=data;
run;
/* Example 4: MVS tape example - import a transport file */
//EXAMP2 JOB (,X101),'SMITH,B.',TIME=(0,5)
// EXEC SAS606
//TRAN DD DISP=OLD,UNIT=TAPE,
// VOL=SER=TRAN02,LABEL=(1,NL),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000,DEN=6250)
//NEW DD DSN=ACTXYZ.EMPLOYEE.SASDATA,
// DISP=(NEW,CATLG),UNIT=DISK,SPACE=(TRKS,(20,5)),
// VOL=SER=DISK10
//SYSIN DD *
libname tran xport;
proc copy in=tran out=new;
exclude dept10 dept12;
run;
/* Example 5: VMS tape example - create a transport file */
/* A. Issue the appropriate command at your site to make */
/* a tape drive available to your session. */
/* */
/* B. Issue the following DCL commands to mount the tape. */
/* You will need to substitute your tape device name in */
/* place of "$2$MUA0:". */
$ DEFINE TRANFL $2$MUA0:
$ ALLOCATE TRANFL
$ MOUNT/FOREIGN/BLOCKSIZE=8000 TRANFL
/* C. Then, execute the following program. */
libname tran xport 'tranfl';
libname old '<actxyz.oldlib>';
proc copy in=old out=tran memtype=data;
run;
/* Example 6: CMS tape example - creating a transport file */
cms filedef tran tap1 nl
(recfm fb lrecl 80 blksize 8000;
run;
libname tran xport;
libname sales91 'b';
proc copy in=sales91 out=tran;
select sept91 oct91;
run;
/* Example 7: UNIX tape example - creating a transport file */
libname tran xport '/dev/tape1';
libname old '/users/myid';
proc copy in=old out=tran;
select jul91;
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Create and read transport files using the XPORT engine and PROC COPY. Tape examples follow with the appropriate system specific information required by each environment.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> COPY
|
| Date Modified: | 2005-12-09 03:02:50 |
| Date Created: | 2005-01-27 08:24:16 |
Operating System and Release Information
| SAS System | Base SAS | All | n/a | n/a |