27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

626 GET DATA<br />

UNENCRYPTED Subcommand<br />

Allows unencrypted passwords to be used in the CONNECT subcommand. This subcommand<br />

has no keywords or arguments<br />

SQL Subcommand<br />

SQL specifies any SQL select statement accepted by the database you access. You can select<br />

columns from more than one related table in an ODBC data source using either the inner join<br />

or the outer join. Each line of the SQL select statement should be enclosed in quotation marks<br />

or apostrophes, and no quoted string should exceed 255 characters.<br />

Example<br />

GET DATA /TYPE=ODBC<br />

/CONNECT=’DSN=saledata.mdb;DBQ=saledata.mdb;DriverId=281;FIL=MS’+<br />

’ Access;MaxBufferSize=2048;PageTimeout=5;’<br />

/SQL=’SELECT ‘T0‘.‘DIV‘ AS ‘DIV‘, ‘T0‘.‘REGION‘ AS ‘REGION‘, ’<br />

’‘T1‘.‘AVGAGE‘ AS ‘AVGAGE‘, ‘T1‘.‘REGION‘ AS ‘REGION1‘ FROM ’<br />

’‘saledata‘.‘EmployeeSales‘ ‘T0‘, ‘‘.‘Regions‘’<br />

’ ‘T1‘ WHERE ‘T1‘.‘REGION‘ = ‘T0‘.‘REGION‘ ’.<br />

Subcommands for TYPE=XLS<br />

For Excel files, you can specify a spreadsheet within the workbook, a range of cells to read,<br />

and the contents of the first row of the spreadsheet (variable names or data).<br />

SHEET Subcommand<br />

The SHEET subcommand indicates the worksheet in the Excel file that will be read. Only one<br />

sheet can be specified. If no sheet is specified, the first sheet will be read.<br />

INDEX n Read the specified sheet number. The number represents the sequential order<br />

of the sheet within the workbook.<br />

NAME ’name’ Read the specified sheet name. If the name contains spaces, it must be<br />

enclosed in quotes or apostrophes.<br />

CELLRANGE Subcommand<br />

The CELLRANGE subcommand specifies a range of cells to read within the specified worksheet.<br />

By default, the entire worksheet is read.<br />

FULL Read the entire worksheet. This is the default.<br />

RANGE ’start:end’ Read the specified range of cells. Specify the beginning column letter<br />

and row number, a colon, and the ending column letter and row<br />

number, as in A1:K14. The cell range must be enclosed in quotes or<br />

apostrophes.

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

Saved successfully!

Ooh no, something went wrong!