I am running a program in teradata sql in SAS using proc sql.
I am creating a month end date that I need to use as a primary index later in the program
here is an example
proc sql exec noerrorstop;
connect to teradata (tdpid=xxxx database='dbname'
SERVER=xxxx username=xxxxxxx password='yyyy' mode=teradata
FASTLOAD=YES);
execute
(
create volatile table xyz as
( select f1
,f2
,(ADD_MONTHS(teradata_dte - EXTRACT (DAY FROM teradata_dte) + 1, (0+1)) - 1) as mo_end_dte
....
fn.
) WITH DATA
ON COMMIT PRESERVE ROWS
)by teradata;
in the above example if the mo_end_dte is the first column listed, the query runs for a long time...as long as an hour
before i cancelled it. in the listed form, it runs in seconds. Likewise if I use it as the first column building a volatile table further in the query (making it a PI) it grinds on forever. Any ideas?
I need to use it as a PI in successive volatile tables.
Thanks for any help.
I am creating a month end date that I need to use as a primary index later in the program
here is an example
proc sql exec noerrorstop;
connect to teradata (tdpid=xxxx database='dbname'
SERVER=xxxx username=xxxxxxx password='yyyy' mode=teradata
FASTLOAD=YES);
execute
(
create volatile table xyz as
( select f1
,f2
,(ADD_MONTHS(teradata_dte - EXTRACT (DAY FROM teradata_dte) + 1, (0+1)) - 1) as mo_end_dte
....
fn.
) WITH DATA
ON COMMIT PRESERVE ROWS
)by teradata;
in the above example if the mo_end_dte is the first column listed, the query runs for a long time...as long as an hour
before i cancelled it. in the listed form, it runs in seconds. Likewise if I use it as the first column building a volatile table further in the query (making it a PI) it grinds on forever. Any ideas?
I need to use it as a PI in successive volatile tables.
Thanks for any help.