| Statements |
| Valid: | anywhere |
| Category: | Data Access |
| Syntax | |
| Arguments | |
| URL Options | |
| Details | |
| Examples | |
| Example 1: Accessing a File at a Web Site | |
| Example 2: Specifying a User ID and a Password | |
| Example 3: Reading the First 15 Records from a URL File | |
| See Also | |
Syntax |
|
FILENAME fileref URL 'external-file'
<url-options>; |
specifies the access method that enables you to read a file from any host machine that you can connect to on a network with a URL server running.
| Alias: | HTTP |
specifies the name of the file that you want to read from on a URL server. The access method must be in one of these forms:
|
https://hostname/file | |
|
https://hostname:portno/file |
Operating Environment Information: For
details about specifying
the physical names of external files, see the SAS documentation for your
operating environment. ![[cautionend]](../common.hlp/images/cautend.gif)
url-options can be any of the following:
where blocksize is the size of the URL data buffer in bytes.
| Default: | 8K |
writes debugging information to the SAS log.
| Tip: | The result of the HELP command is returned as records. |
where lrecl is the logical record length.
| Default: | 256 |
where password is the password to use with the user name that is specified in the USER option.
| Tip: | You can specify the PROMPT option instead of the PASS option, which tells the system to prompt you for the password. |
specifies to prompt for the user login password if necessary.
| Tip: | If you specify PROMPT, you do not need to specify PASS=. |
specifies the Uniform Resource Locator (URL) for the proxy server in one of these forms:
where recfm is one of three record formats:
| F |
is fixed-record format. Thus, all records are of size LRECL with no line delimiters. Data is transferred in image (binary) mode. | ||||
| S |
is stream-record format. Data is transferred in image (binary) mode.
| ||||
| V |
is variable-record format (the default). In this format, records have varying lengths, and they are transferred in text (stream) mode.
|
| Default: | V |
where username is used to log on to the URL server.
| Tip: | If you specify user='*' , then the user is prompted for an ID. |
| Interaction: | If PROMPT is specified, but USER= is not, the user is prompted for an ID as well as a password. |
| Details |
The Secure Sockets Layer (SSL) protocol is used when the URL begins with "https" instead of "http". The SSL protocol provides network security and privacy. Developed by Netscape Communications, SSL uses encryption algorithms that include RC2, RC4, DES, tripleDES, IDEA, and MD5. Not limited to providing only encryption services, SSL can also perform client and server authentication and use message authentication codes. SSL is supported by both Netscape Navigator and Internet Explorer. Many Web sites use the protocol to provide confidential user information such as credit card numbers. The SSL protocol is application independent, enabling protocols such as HTTP, FTP, and Telnet to be layered transparently above it. SSL is optimized for HTTP.
Operating Environment Information: Using
the FILENAME statement requires information that is specific to your operating
environment. The URL access method is fully documented here, but for more
information about how to specify filenames, see the SAS documentation for
your operating environment. ![[cautionend]](../common.hlp/images/cautend.gif)
| Examples |
This example accesses document test.datat site www.a.com:
filename foo url 'http://www.a.com/test.dat'
proxy='http://www.gt.sas.com';
This example accesses document file1.html at site www.b.com and requires a user ID and password:
filename foo url 'http://www.b.com/file1.html'
user='jones' prompt;
This example reads the first 15 records from a URL file and writes them to the SAS log with a PUT statement:
filename foo url
'http://support.sas.com/techsup/service_intro.html';
data _null_;
infile foo length=len;
input record $varying200. len;
put record $varying200. len;
if _n_=15 then stop;
run;
| See Also |
|
Statements: | |||||||||||||
|
Using SSL in UNIX Environments in SAS Companion for UNIX Environments | |||||||||||||
|
Using SSL under Windows in SAS Companion for the Microsoft Windows Environment |
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.