Figure 2.1 SAS Processing
Raw Data:
External Files
Instream Data
Remote access through:
Catalog
FTP
TCP/IP socket
URL
SAS
Data Set
SAS Data Sets:
SAS Data Files
SAS Data Views:
PROC SQL Views (native)
DATA Step Views (native)
SAS/ACCESS Views (interface)
DATA
Step
PROC
Step
External Files:
SAS Log
Reports
External Data Files
SAS
Data Set
Report
SAS
Log
You can use different types of data as input to a DATA step. The DATA step includes
SAS statements that you write, which contain instructions for processing the data. As
each DATA step in a SAS program is compiling or executing, SAS generates a log that
contains processing messages and error messages. These messages can help you debug a
SAS program.
Types of Input to a SAS Program
You can use different sources of input data in your SAS program:
SAS data sets
can be one of two types:
SAS
data
files
store actual data values. A SAS data file consists of a descriptor
portion that describes the data in the file, and a data portion.
SAS
views
contain references to data stored elsewhere. A SAS view uses
descriptor information and data from other files. It enables you to
dynamically combine data from various sources, without using
storage space to create a new data set. SAS views consist of DATA
step views, PROC SQL views, and SAS/ACCESS views. In most
cases, you can use a SAS view as if it were a SAS data file.
For more information, see Chapter 28, “SAS Data Files,” on page 615 and Chapter
29, “SAS Views,” on page 675.
Raw data
specifies unprocessed data that have not been read into a SAS data set. You can read
raw data from two sources:
External
files
contain records comprised of formatted data (data is arranged in
columns) or free-formatted data (data that are not arranged in
columns).
14 Chapter 2 SAS Processing
Instream
data
is data included in your program. You use the DATALINES
statement at the beginning of your data to identify the instream
data.
For more information about raw data, see Chapter 21, “Reading Raw Data,” on page
439.
Remote access
enables you to read input data from nontraditional sources such as a TCP/IP socket
or a URL. SAS treats this data as if it were coming from an external file. SAS
enables you to access your input data remotely in the following ways:
SAS catalog specifies the access method that enables you to reference a SAS
catalog as an external file.
Clipboard specifies the access method that enables you to read or write
text data to the clipboard on the host computer.
DATAURL specifies the access method that enables you to access remote
files by using the DATAURL access method.
FTP specifies the access method that enables you to use File
Transfer Protocol (FTP) to read from or write to a file from any
host computer that is connected to a network with an FTP
server running.
Hadoop specifies the access method that enables you to access files on a
Hadoop Distributed File System (HDFS) whose location is
specified in a configuration file.
SFTP specifies the access method that enables you to use Secure File
Transfer Protocol (SFTP) to read from or write to a file from
any host computer that is connected to a network with an Open
SSH SSHD server running.
TCP/IP
socket
specifies the access method that enables you to read from or
write to a Transmission Control Protocol/Internet Protocol
(TCP/IP) socket.
URL specifies the access method that enables you to use the uniform
resource locator (URL) to read from and write to a file from
any host computer that is connected to a network with a URL
server running.
WebDAV specifies the access method that enables you to use the
WebDAV protocol to read from or write to a file from any host
computer that is connected to a network with a WebDAV server
running.
ZIP specifies the access method that enables you to access ZIP files
by using zlib services.
For more information about accessing data remotely, see the following topics:
“FILENAME Statement, CLIPBOARD Access Method” in SAS Global
Statements: Reference
“FILENAME Statement, CATALOG Access Method” in SAS Global Statements:
Reference
“FILENAME Statement, DATAURL Access Method” in SAS Global Statements:
Reference
Types of Input to a SAS Program 15

Get SAS 9.4 Language Reference, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.