DBCREATE_TABLE_LOCATION= LIBNAME Statement Option

Specifies the default location for external tables.

Valid in: SAS/ACCESS LIBNAME statement
Category: Data Set Control
Aliases: DBCREATE_LOCATION=
DBCREATE_LOC=
DBCREATE_PATH=
Default: None
Requirement: You must specify the DBCREATE_TABLE_EXTERNAL= LIBNAME option when you specify this option.
Data source: Hadoop
Note: Support for this option starts in SAS 9.4M8.
See: DBCREATE_TABLE_EXTERNAL= LIBNAME option, DBCREATE_TABLE_OPTS= LIBNAME option, DBCREATE_TABLE_LOCATION= data set option

Syntax

DBCREATE_TABLE_LOCATION='path'

Syntax Description

'path'

specifies the default location for storing external tables.

Details

This option causes SAS to include the LOCATION keyword in its CREATE TABLE query, along with the specified path. When using the LIBNAME option and creating a new table, the table’s name is appended to the user’s path.

Note: The usage of the DBCREATE_TABLE_LOCATION= LIBNAME option is slightly different than the DBCREATE_TABLE_LOCATION= data set option. The LIBNAME option specifies the default location for any CREATE TABLE queries generated by SAS. SAS appends the table’s name to the path, resulting in a fully qualified path. When using the data set option, you must specify the absolute path, including the table’s name.

Example: Create a Hive Table outside of the Hive Warehouse

In this example, the combination of DBCREATE_TABLE_LOCATION='/tmp/extdir' and DBCREATE_TABLE_EXTERNAL=YES alters the CREATE TABLE query generated by the SAS DATA step.

libname x HADOOP user=xxxxxx pwd=xxxxxx
driverclass=com.cloudera.hive.jdbc.HS2Driver
DBCREATE_TABLE_EXTERNAL=yes
dbcreate_table_location='/tmp/extdir'
url='jdbc:hive2://host:port/database;useNativeQuery=1;defaultStringColumnLength=2048;
hive.exec.drop.ignorenonexistent=false';

data x.class;
 set sashelp.class;
run;
HADOOP_6: Executed: on connection 2
CREATE EXTERNAL TABLE `default`.`CLASS` (`Name` VARCHAR(8),`Sex` VARCHAR(1),`Age` DOUBLE,`Height` DOUBLE,`Weight` DOUBLE)
LOCATION '/tmp/extdir/class' TBLPROPERTIES ('SAS OS Name'='Linux','SAS Version'='V.04.00M0D03312022')
Last updated: February 3, 2026