Chapter Contents |
Previous |
Next |
Some SAS/ACCESS software products support a DATA step interface, which allows 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 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 on 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 allow 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 INFILE statement options that can be used with your DBMS.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.