This section describes the LIBNAME statement options that SAS/ACCESS Interface to Google BigQuery supports. For general information about this feature, see LIBNAME Statement for Relational Databases.
Here is the LIBNAME statement syntax for accessing Google BigQuery.
For general information about the LIBNAME statement that is not specific to SAS/ACCESS, see LIBNAME Statement in SAS Global Statements: Reference.
specifies any SAS name that serves as an alias to associate SAS with a database, schema, server, or group of tables and views.
bigqueryspecifies the SAS/ACCESS engine name for the Google BigQuery interface.
provide connection information and control how SAS manages the timing and concurrence of the connection to the DBMS. When you use the LIBNAME statement, you can connect to the Google BigQuery database in several ways.
Here is how these options are defined.
specifies the location of a credential file that enables authentication to Google Cloud Platform.
This value is masked in the SAS log. This option accepts values that have been encoded using PROC PWENCODE. SAS/ACCESS recognizes encoded values as those that begin with a SAS encoding tag. For more information, see PWENCODE Procedure in Base SAS Procedures Guide.
For more information about the credential file, see the getting started information in your Google Cloud documentation.
Valid in: SAS/ACCESS LIBNAME statement
Aliases: CREDPATH=, CRED_FILE=, CREDFILE=
Default: none
Requirement: You must use single quotation marks around the value for CRED_PATH=.
Example: cred_path='/u/authfiles/BigQuery/xxx-yyy-8e99c10a22537.json'
specifies the project ID for a Google Cloud Platform project.
Valid in: SAS/ACCESS LIBNAME statement
Default: none
Requirement: This value is required to access Google BigQuery in a LIBNAME statement.
Example: project='project1'
specify how SAS processes DBMS objects. Some LIBNAME options can enhance performance, and others determine locking or naming behavior. The following table describes the LIBNAME options for SAS/ACCESS Interface to Google BigQuery with the applicable default values. This table also identifies LIBNAME options that are valid in the CONNECT statement in the SQL procedure. For details, see LIBNAME Options for Relational Databases.
|
Option |
Default Value |
Valid in CONNECT |
|---|---|---|
|
none |
|
|
|
OFF |
||
|
none |
● |
|
|
temporary file directory that is specified by the UTILLOC= system option |
● |
|
|
YES |
● |
|
|
bell character (ASCII 0x07) |
● |
|
|
4 |
● |
|
|
NO |
● |
|
|
NO |
||
|
none |
||
|
none |
||
|
Maximum number of bytes per character for the current session encoding |
● |
|
|
none |
|
|
|
DBMS |
● |
|
|
COMPAT |
|
|
|
none |
|
|
|
NO |
● |
|
|
YES |
|
|
|
none |
|
|
|
none |
|
|
|
Trace file is overwritten and contains no time stamps or thread identification. |
|
|
|
FLOAT64 |
|
|
|
NO |
|
|
|
none |
|
|
|
JSON |
|
|
|
INFO |
|
|
|
NO |
|
|
|
automatically calculated based on row length |
|
|
|
_sasbq_temp_tables |
||
|
86400000 |
||
|
none |
|
|
|
2000 |
|
|
|
2000 |
|
|
|
STANDARD |
|
|
|
NONE |
|
|
|
none |
|
|
|
none |
|
|
|
none |
|
|
|
STANDARD |
|
|
|
automatically calculated based on row length |
● |
|
|
none |
||
|
NO |
||
|
none |
|
|
|
YES |
|
|
|
none |
|
|
|
none |
|
|
|
none |
||
|
NO |
● |
|
|
NO |
● |
|
|
none |
● |
|
|
none |
|
|
|
YES |
|
If you experience an exception while connecting to Google BigQuery with a LIBNAME statement, then you might need to specify a value for the GOMEMLIMIT= environment variable. This variable must be set from the command line prior to starting your SAS session. Here is an example that shows how to set this variable:
export GOMEMLIMIT=250MiB
For more information about setting this environment variable during configuration, see Configure SAS/ACCESS Interface to Google BigQuery.
Use the following example to establish a connection between SAS and Google BigQuery. This example connects to project Project1 in schema Meddata.
libname mydb bigquery project='Project1' schema='Meddata';
If you require a credentials file, you might specify a LIBNAME statement like this one:
libname mydb bigquery project='Project1' schema='Meddata'
cred_path='/u/fedadmin/BigQuery/xxx-yyy-9e99c10a8888.json';