Hello, I'm trying to run what I thought is some quite simple code, but it's taking hours to complete. I'm trying to create a table in SAS using data from a table in Teradata. There should be around 26 million rows. Does anyone have any idea what the problem could be? I should say that I have only been using SAS for around four weeks and haven't had any training! I'm used to Oracle SQL. My code is here:
%macro creator;
proc sql noprint;
%connect_to_teradata_dna06;
create table TotalData_27NOV18 as
select * from connection to tera
(
select *
from bsp_bd_sd_dna06.kde_cdb_pcust_totaldata_19nov18
);
disconnect from tera;
quit;
%mend;
%creator;
Check if the underlying Teradata table have any partitions or indexes. Your query is going for a full table scan which is not optimal . Consider splitting your query into smaller subsets as suggested by @Reeza .
To check the Underlying partitions/indexes in you table use the syntax
Show table <table_name>.
Also I would suggest running a sample query to test the waters before running query without filters :
proc sql noprint;
%connect_to_teradata_dna06;
create table TotalData_27NOV18 as
select * from connection to tera
(
select *
from bsp_bd_sd_dna06.kde_cdb_pcust_totaldata_19nov18
sample 1000
);
disconnect from tera;
quit;
thank you
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.