- Example 1:
- This example creates a data set transport file on tape. Only one data set, JUL91, is copied. The tape device name in this example is '/dev/tape1'. This example
assumes that the tape has an LRECL=80 and BLOCKSIZE=8000.
libname tran xport '/dev/tape1';
libname old '/users/myid';
proc copy in=old out=tran;
select jul91;
run;
- Example 2:
- In this example, we are creating a transport file during a SAS DATA step. The XPORT engine's special set of input/ output routines are used to create the transport
file during the DATA step. The transport file contains all the variables and observations from the permanently stored SAS data set USERS found in the directory referenced
by the libref SASDATA, plus the variable STATUS.
libname sasdata '~userid/tech';
libname gone xport '~userid/tech/tranfile.dat';
data gone.account;
set sasdata.users;
if code='00003' then status='ALERT';
else status='REG';
run;
- Example 3:
- Here we are creating a transport file with all the SAS data sets in the directory except the EMPLOYEE and CONSULT SAS data sets.
libname sasdata '~userid/tech';
libname gone xport '~userid/tech/tranfile.dat';
proc copy in=sasdata out=gone;
exclude employee consult;
run;
- Example 4:
- This example is a modification of Example 2 above. In this example, we are using PROC CPORT to create the transport file.
Note:
This transport file
can only be processed by a PROC CIMPORT at the same or higher release.
libname sasdata '~userid/tech';
filename gonefile '~userid/tech/portfile.dat';
data work.account;
set sasdata.users;
if code='00003' then status='ALERT';
else status='REG';
run;
proc cport data=work.account file=gonefile;
run;
- Example 5:
- In this example, we are simply placing the path and physical name of the file in the FILE= option of the PROC CPORT statement. Because UNIX does not use file characteristics,
we can simpify the coding.
libname sasdata '~userid/tech';
proc cport data=sasdata.users file='~userid/tech/portfile.dat';
run;
- Example 6:
- This example is similar to Example 5 above except we are copying all the SAS data sets in the directory referenced by the libref SASDATA into the transport
file.
libname sasdata '~userid/tech';
proc cport library= sasdata
file='~userid/tech/portfile.dat'
memtype=data ;
run;