1

When loading tables from SAS to Teradata, SAS loads the data (usually using the FASTLOAD facility) and then continues down the script. However, I often get critical errors because SAS says the data is loaded, but Teradata is still assembling the data within the table.

So the data is in the database, but not ready to be used. I have yet to find a way to know if the data is ready for processing with other tables. I have been successful at using a sleep command, but that is arbitrary and unreliable (because who knows how long it will take).

How would you fix this problem?

AFHood
  • 990
  • 3
  • 14
  • 25
  • I have had a similar problem with Sybase and have not found any other solution than waiting/doing some other stuff before accessing the database. – Ville Koskinen Jul 15 '09 at 11:58
  • if you select from the target table right after the end of fastload you may be getting the "data is still being loaded" response. So as Mr.Koskinen suggested, loop with a wait, until a single row is returned.. – access_granted Oct 10 '18 at 01:06

3 Answers3

0

Could you sleep, try to query, catch any error and loop until ready?

Jon
  • 4,957
  • 5
  • 27
  • 38
0

Refining Jon's answer, you might want to look at querying whether the processing has ended.

I'm not familiar with Teradata, but supposedly there has to be a systems table listing active processes. It might possible to use pass through SQL to query get the current processes.

Ville Koskinen
  • 1,256
  • 1
  • 14
  • 20
0

I would try the following:

  1. Test if the DBCOMMIT= data set option can help
  2. If 1. doesn't help, use a loop over the OPEN function to query if the table is ready, like this:

    data _null_;
      dsid=0;
      do i=1 to 3600 while(dsid<=0);
         ts=SLEEP(1,1);
         dsid=OPEN('TERADATA.MYTABLE','I');
      end;
      if dsid then dsid=CLOSE(dsid);
    run;
    
Martin Bøgelund
  • 1,641
  • 16
  • 25