You
transfer a foreign file in the same way that you transfer a transport
file. The only difference between the two is the filename. SAS appends
a transport filename with an appropriate member type extension, such
as .DAT for a data set. A file that was created with CEDA features
is appended with an appropriate SAS 9 or SAS 8 filename extension,
such as .SAS9BDAT for a data set.
In these examples,
TRANFILE specifies the name of the transport file that is transferred
across the network. TARGET specifies the destination for the file
in foreign format or the transport file on the target computer.
This
example shows FTP commands that are used at the source computer to
put a foreign file or a transport file on the target computer:
/* putting transport file on the target computer */
> open target-computer
> binary
> put tranfile target-computer-filename
> close
> quit
This
example shows FTP commands that are used at the target computer to
get a foreign file or a transport file from the source computer:
/* At the target computer, getting transport file from */
/* the source computer */
> open source-computer
> binary
> get tranfile source-computer-filename
> close
> quit
If you have access to
a UNIX system, see the
ftp
(1) manual page
for more details.
Note: In order to copy a file with
the FTP
put
command to a server location,
you must have write permission to the target location on the server.
Because a local user's permission to put a file at a server location
is uncertain, it is recommended that the remote user use the FTP
get
command to obtain the file from the client instead.
The local user must give read and write permission to the file that
the remote user accesses.
This code shows an example
of user JOE at the target computer getting two transport files from
an OpenVMS source computer:
hp> ftp myhost.mycompany.com 1
Connected to myhost.mycompany.com
220 myhost.mycompany.com MultiNet FTP Server Process V4.0(15)
at Mon 13-Jan-03 12:59PM-EDT
Name (myhost.mycompany.com:): joe
331 User name (joe) ok. Password, please.
Password:
230 User JOE logged into DISK01:[JOE] at Mon 13-Jan-03
12:59PM-EDT, job 27a34cef.
Remote system type is VMS.
ftp> cd [.xpttest] 2
250 Connected to DISK01:[JOE.XPTTEST].
ftp> binary 80 3
200 Type I ok.
ftp> get xptds.dat xptds.dat 4
200 Port 14.83 at Host 10.26.2.45 accepted.
150 IMAGE retrieve of DISK01:[JOE.XPTTEST]XPTDS.DAT;1 started.
226 Transfer completed. 1360 (8) bytes transferred. 5
1360 bytes received in 0.02 seconds (87.59 Kbytes/s)
ftp> get xptlib.dat xptlib.dat 6
200 Port 14.84 at Host 10.26.2.45 accepted.
150 IMAGE retrieve of DISK01:[JOE.XPTTEST]XPTLIB.DAT;1 started.
226 Transfer completed. 3120 (8) bytes transferred. 7
3120 bytes received in 0.04 seconds (85.81 Kbytes/s)
ftp> quit 8
1From an HP-UX operating environment, the user invokes FTP to connect
to the OpenVMS operating environment MYHOST.MYCOMPANY.COM.
2After a connection is established between the HP-UX source computer
and the OpenVMS target computer, at the FTP prompt, the user JOE changes
to the directory on the target computer that contains transport file
XPTTEST.
3 Transport file attributes BINARY 80 indicate that the OpenVMS transport
file be transferred to the source computer in BINARY format in 80-byte
records.
4 The FTP command gets the transport file named XPTDS.DAT from the
target computer and copies it to a new file that has the same name,
XPTDS.DAT, in the current directory.
5Messages indicate that the transfer was successful and that the length
of the transport file was 1360 bytes.
6The FTP command gets another transport file named XPTLIB.DAT from
the target computer and copies it to a new file that has the same
name, XPTLIB.DAT, in the current directory.
7Messages indicate that the transfer was successful and that the length
of the transport file was 3120 bytes.
8The user quits the FTP session.