DATA Step, Macro, Functions and more

Azure Reading SAS Datasets

Reply
Occasional Contributor
Posts: 19

Azure Reading SAS Datasets

Dear SAS Community,

Does anyone have experience using Azure SQL Server to read in a sas7bdat file. I found this article saying R can do it as a plug into SQL Server. The reason I ask is that in using a DSN libname to Azure, putting the sashelp.class (19 records, less than 50 KB) table on Azure takes 33 seconds and I need Azure to handle 90 GB of data transfers.

 

https://social.msdn.microsoft.com/Forums/en-US/da14839c-94bf-4ba3-b0cc-e3801d53760d/use-sas7bdat-for...

 

I would prefer a direct read without adding another tool. Thank you,

 

Sumner

Regular Contributor
Posts: 213

Re: Azure Reading SAS Datasets

Hi,

 

If you are using SAS/ACCESS to ODBC to interact with MS SQL Server on Azure, check out the BULKLOAD= option for you ODBC libname statemant.

 

and while you are at it, I would recommend enabling SAS/ACCESS tracing/debugging via the following options

 

/*Turn on SAS tracing */
options sastrace=”,,t,” sastraceloc=saslog nostsuffix;

 

For additional details and usage examples, Check this SGF paper "SASTRACE: Your Key to RDBMS Empowerment"

 

Hope this helps,

Ahmed

 

 

 

Occasional Contributor
Posts: 19

Re: Azure Reading SAS Datasets

The issue is I get this message. I hadnlt considered using sastrace. Thank you for reminding meof it.

 

ERROR: BCP initialize error: [Microsoft][ODBC Driver 13 for SQL Server]Connection is not

enabled for BCP

 

Does anyone know how to turn BCP on for Azure?

Frequent Contributor
Posts: 119

Re: Azure Reading SAS Datasets

Hi Sumner,

 

the R Services are only available for SQL Server on premise. I think Azure SQL DB does not support R code and R packages yet.

 

If you plan to shift that much data into the cloud you should also consider other scenarios like exporting your data into CSV files and send the data on a HDD disk to your Azure datacenter. You can process the data much faster if it is already located in the cloud Smiley Happy

Super User
Posts: 9,681

Re: Azure Reading SAS Datasets

Yeah. You push a too big table into DB.

Here are some options could get you a little faster.

 

options DBIDIRECTEXEC;
libname x ...... insertbuff=10000 bulkload=yes dbicommit ;

Occasional Contributor
Posts: 19

Re: Azure Reading SAS Datasets

Thank you. DBIcommit isn;t an option is SAS 9.2. The

options DBIDIRECTEXEC; seems to have sped up the process, but not by enough to use it.

 

I am going with the BCP load option available in SQL Server

Ask a Question
Discussion stats
  • 5 replies
  • 183 views
  • 1 like
  • 4 in conversation