13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>SAS</strong>/<strong>ACCESS</strong> Interface to DB2 Under z/OS 4 Syntax 501specifies a mapping data set that contains in<strong>for</strong>mation such as DB2 names, <strong>SAS</strong>variable names, and <strong>for</strong>mats <strong>for</strong> input to PROC DB2EXT.This option is available <strong>for</strong> use only with previously created mapping data sets.You cannot create new mapping data sets with DB2EXT.OUT=<strong>SAS</strong>-data-set | libref.<strong>SAS</strong>-data-setspecifies the name of the <strong>SAS</strong> data set that is created. If you omit OUT=, the dataset is named "work.DATAn", where n is a number that is sequentially updated.The data set is not saved when your <strong>SAS</strong> session ends. If a file with the name thatyou specify in the OUT= option already exists, it is overwritten. However, youreceive a warning that this is going to happen.SSID=subsystem-namespecifies the name of the DB2 subsystem that you want to access. If you omitSSID=, the subsystem name defaults to DB2.The subsystem name defaults to the subsystem that is defined in theDB2SSID= option. It defaults to DB2 only if neither the SSID= option nor theDB2SSID= option are specified.FMT StatementFMT column-number-1=’<strong>SAS</strong>-<strong>for</strong>mat-name-1’;The FMT statement assigns a <strong>SAS</strong> output <strong>for</strong>mat to the DB2 column that is specifiedby column-number. The column-number is determined by the order in which you listthe columns in your SELECT statement. If you use SELECT *, the column-number isdetermined by the order of the columns in the database.You must enclose the <strong>for</strong>mat name in single quotation marks. You can specifymultiple column <strong>for</strong>mats in a single FMT statement.RENAME StatementRENAME column-number-1=’<strong>SAS</strong>-name-1’;The RENAME statement assigns the <strong>SAS</strong>-name to the DB2 column that is specifiedby column-number. The column-number is determined by the order in which you listthe columns in your SELECT statement. If you use SELECT *, the column-number isdetermined by the order of the columns in the database.You can rename multiple columns in a single RENAME statement.SELECT StatementSELECT DB2-SQL-statement;The DB2-SQL-statement defines the DB2 data that you want to include in the <strong>SAS</strong>data set. You can specify table names, column names, and data subsets in yourSELECT statement. For example, this statement selects all columns from the Employeetable and includes only employees whose salary is greater than $40,000.select * from employee where salary > 40000;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!