Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8101947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:06:48+00:00 2026-06-05T23:06:48+00:00

I’m trying to load a table, create an index, collect statistics, grant select permissions

  • 0

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;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:06:49+00:00Added an answer on June 5, 2026 at 11:06 pm

    Everything looks fine to me. How do you know the COLLECT and GRANT commands did not work? Did you get an error message?

    A couple notes:

    In your PROC SQL CONNECT statement, I suggest that you add the option MODE=TERADATA; that will put the connection in “Teradata” rather than “ANSI” mode, one benefit of which is that commands are “committed” automatically; you do not need those “commit” steps.

    Also in your PROC SQL CONNECT statement, you are specifying the SCHEMA option; I don’t think that has any effect. Everything in the EXECUTE block must be pure Teradata syntax, so fully qualify all table references.

    Be sure that your COLLECT STATISTICS statement is on “index ()” not “index().

    Finally, I strongly suggest that you explicitly define the tables primary index and data type using the DBCREATE_TABLE_OPTS and DBTYPE data set options when you create the table, something like:

    data ias.<tablename>
         (bulkload-yes sleep=10 tenacity=4
          dbcreate_table_opts='primary index(<columnname>)'
          dbtype=(  <columnname>='<teradata column definiton>'
                  , <anothercolumn>='<teradata column definition>'
                 ));
           set WORK.<data set name>;
    run;
    

    If you do not name the index explicitly, the first variable in your SAS data set will be selected for the index (which may or may not be correct), and the data type might not be appropriate.

    If you still have problems, post back with any error messages; and please use an exact example (don’t hide column and table names with bracketed references).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.