GET DATA
GET DATA
reads data from ODBC and OLE DB data sources (databases), Excel
files (release 5 or later), and text data files.
GET DATA
/TYPE = {ODBC }
{OLEDB}
{XLS }
{XLSX }
{XLSM }
{TXT }
/FILE = ’filename’
Subcommands for TYPE = ODBC and OLEDB
/CONNECT=’connection string’
[{/ENCRYPTED }]
{/UNENCRYPTED}
/SQL ’select statement’
[’select statement continued’]
Subcommands for TYPE=ODBC, TYPE=OLEDB, XLS, XLSX, and XLSM
[/ASSUMEDSTRWIDTH={255**}]
{n }
Subcommands for TYPE = XLS, XLSX, and XLSM*
[/SHEET = {INDEX**} {sheet number}]
{NAME } {’sheet name’}
[/CELLRANGE = {RANGE } {’start point:end point’ }]
{FULL**}
[/READNAMES = {on** }]
{off }
[/DATATYPEMIN PERCENTAGE=value]
[/HIDDEN IGNORE=(NO**}]
{YES }
[/LEADINGSPACES IGNORE={NO**}]
{YES }
[/TRAILINGSPACES IGNORE={NO**}]
{YES }
Subcommands for TYPE = TXT
[/ENCODING = {'UTF8' }]
{'UTF16' }
{'UTF16BE'}
{'UTF16LE'}
{'LOCALE' }
[/ARRANGEMENT = {FIXED }]
{DELIMITED**}
[/FIRSTCASE = {n}]
[/DELCASE = {LINE** }]1
{VARIABLES n}
[/FIXCASE = n]
[/DELIMITERS = {"delimiters"}]
[/QUALIFIER = "qualifier"]
[/IMPORTCASE {ALL**}
{FIRST n}
[/DATATYPEMIN PERCENTAGE=value]
[/LEADINGSPACES IGNORE={NO**}]
{YES }
[/MULTIPLESPACES IGNORE={NO**}]
{YES }
VARIABLES subcommand for ARRANGEMENT = DELIMITED
/VARIABLES = varname {AUTO }
{format}
VARIABLES subcommand for ARRANGEMENT = FIXED
/VARIABLES varname {startcol - endcol} {AUTO | format}
{/rec#} varname {startcol - endcol} {AUTO | format}
[/MAP]
*For Excel 4.0 or earlier files, use GET TRANSLATE
.
**Default if the subcommand is omitted.
Syntax for
the GET DATA
command can be generated from the Database Wizard, the Text Import Wizard,
or the Open File dialog
(for Excel files).
Release history
Release 13.0
-
ASSUMEDSTRWIDTH
subcommand introduced forTYPE=ODBC
.
Release 14.0
-
ASSUMEDSTRWIDTH
subcommand extended toTYPE=XLS
. -
TYPE=OLEDB
introduced.
Release 15.0
-
ASSUMEDSTRWIDTH
subcommand extended toTYPE=OLEDB
.
Release 16.0
-
TYPE=XLSX
andTYPE=XLSM
introduced.
Release 17.0
-
ENCRYPTED
subcommand introduced.
Release 21.0
-
ENCODING
subcommand introduced.
Release 23.0
UTF16
,UTF16BE
, andUTF16LE
keywords added toENCODING
subcommand.
Release 24.0
AUTO
keyword introduced.DATATYPEMIN
subcommand introduced.HIDDEN
subcommand introduced.LEADINGSPACES
subcommand introduced.MAP
subcommand introduced.MULTIPLESPACES
subcommand introduced.TRAILINGSPACES
subcommand introduced.
Example
GET DATA
/TYPE=XLS
/FILE='/PlanningDocs/files10.xls'
/SHEET=name 'First Quarter'
/CELLRANGE=full
/READNAMES=on.