I'm trying to create a table in a SQL database using proc SQL. My dataset is 200K records and has twenty variables. However, some of them are free text variables and have huge informats like $3000 -- So my final file ends up being about 2GB. I don't have any meta information on the source file so I'm not able to say if I can save space anywhere. The problem is that the table takes too long to load, about 5 hours run time.
Am I able to adjust the auto-growth? Or check what the default is?
Would the explicit SQL pass-thru be any help?
Also, not helping things is the SAS Server is in the EU and SQL Server is in the US.
I haven't tried adding these options but maybe they would help:
options compress=yes sastrace=',,,d' sastracelog=log notsuffix;
My code looks like this:
libname DB odbc noprompt="driver=XXX server=XXX database=XXX";
proc sql;
create table DB.BigTable;
as select *
from work.BigDataSet;
quit;
Edited post to include information from @ChrisNZ questions
What's the issue?
Is the process too slow?
Is the table too large?
How do you talk to SQL Server?
SAS/ACCESS Interface to ODBC?
SAS/ACCESS Interface to OLEDB?
SAS/ACCESS Interface to Microsoft SQL Server?
Well, @SAShole,
Part of the problem is that you're using ODBC which isn't typically the best. DB specific drivers are typically faster. But of course we have what we have.
With Hive with ODBC, I found setting the INSERTBUFF and DBCOMMIT both in conjunction with one another to 32767 was the fastest -- significantly faster than not setting them, but I can't say what setting would be best for your situation. @SASKiwi and @ChrisNZ helped me tremendously and walked me through that process, so you're in good hands there.
Jim
See if the variables really need to be that long.
ODBC does not have a FASTLOAD option, but try adding insertbuff=10000 to your ODBC LIBNAME statement.
Tweak the figure to see what's fastest for your data.
The other option which might help is DBCOMMIT. Try similar values with that too.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.