I'm trying to load a table, create an index, collect statistics, grant select permissions on a table in teradata using SAS to complete the work. SAS is the only piece of software I have to choose from.
The following script successfully deletes the table, load the table, creates the indexes but doesn't collect statistics or grant select. Is there another way of doing this, or am I doing this incorrectly?
libname ias teradata server=<server> USER=&tduser. schema=<dbname> password=&tdpass.;
proc datasets library=ias;
delete <tablename>;
run;
data ias.<tablename> (bulkload=yes sleep=10 tenacity=4 dbcommit=80000);
set WORK.<data set name>;
run;
proc sql;
connect to teradata as td (user=&tduser. password=&tdpass. tdpid="<server>" schema="<dbname>");
execute(create index <indexname> (<columnname>) on <dbname>.<tablename>) by td;
execute(commit) by td;
execute(collect statistics on <dbname>.<tablename> index (<columnname>);
execute(commit) by td;
execute(grant select on <dbname>.<tablename> to <list of users>) by td;
execute(commit) by td;
disconnect from td;
run;