BookmarkSubscribeRSS Feed
annisamalik_
Calcite | Level 5

Hallo, please kindly help me. I want to export my sasdat to SQL Server, but why it tooks too much time. I want export my data (8million rows) and it takes time 14hours. How to solve it? How to make my SAS run fast? Thanks

2 REPLIES 2
s_lassen
Meteorite | Level 14

With that kind of data, you will probably want to look at the BULKLOAD option for creating data. Apparently the BULKLOAD option is only available if you use ODBC to connect to the data - and the ODBC functionality may be a bit too simple in some cases - I have once or twice been forced to create the bulkload file myself and use the command-line interface to SQL server (BCP command) to load the data. It is also possible to use the BULK INSERT command in SQL Server (use pass-through SQL), which you can initiate using pass-through SQL, I think the functionality is similar to the BCP command.

 

If you are using ODBC, and you can live with how the data comes out, that is probably the easiest, just specify e.g.:

libname sqlserv ODBC <connect options>;

data sqlserv.out_table(bulkload=YES);
  set <sas dataset>;
run;
  

 

Another possibility is to increase the value of the INSERTBUFF dataset (or libname) option. Not as fast as bulk loading, but it is still a good way of increasing throughput.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 654 views
  • 0 likes
  • 3 in conversation