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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.