Interface DATA Step Engine
Some SAS/ACCESS software products support a DATA step interface. This support
enables you to read data from your DBMS by using DATA step programs. Some
products support both reading and writing in the DATA step interface.
The DATA step interface consists of four statements:
The INFILE statement identifies the database or message queue to be accessed.
The INPUT statement is used with the INFILE statement to issue a GET call to
retrieve DBMS data.
The FILE statement identifies the database or message queue to be updated, if
writing to the DBMS is supported.
The PUT statement is used with the FILE statement to issue an UPDATE call, if
writing to the DBMS is supported.
The following example updates data in an IMS database by using the FILE and INFILE
statements in a DATA step. The statements generate calls to the database in the IMS
native language, DL/I. The DATA step reads Bank.Customer, an existing SAS data set
that contains information about new customers, and then it updates the ACCOUNT
database with the data in the SAS data set.
data _null_;
set bank.customer;
length ssa1 $9;
infile accupdt dli call=func dbname=db ssa=ssa1;
file accupdt dli;
func = 'isrt';
db = 'account';
ssa1 = 'customer';
put @1 ssnumber $char11.
@12 custname $char40.
@52 addr1 $char30.
@82 addr2 $char30.
@112 custcity $char28.
@140 custstat $char2.
@142 custland $char20.
@162 custzip $char10.
@172 h_phone $char12.
@184 o_phone $char12.;
if _error_ = 1 then
abort abend 888;
run;
In SAS/ACCESS products that provide a DATA step interface, the INFILE statement has
special DBMS-specific options that enable you to specify DBMS variable values and to
format calls to the DBMS appropriately. See the SAS/ACCESS documentation for your
DBMS for a full listing of the DBMS-specific INFILE statement options and the Base
SAS INFILE statement options that can be used with your DBMS.
714 Chapter 33 About SAS/ACCESS Software

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.