13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

812 Teradata Processing Tips <strong>for</strong> <strong>SAS</strong> Users 4 Chapter 28do x=2001 to 3000;output;end;run;/* Append the <strong>SAS</strong> data to the Teradata table. */proc append data=work.testdata base=trlib.mlfload(MultiLoad=yes);run;This example loads data using TPT FastLoad./* Check the <strong>SAS</strong> log <strong>for</strong> this message to verify that the TPT API was used.NOTE: Teradata connection: TPT Fastload has inserted 100 rows.*/data trlib.load(TPT=YES FASTLOAD=YES);do x=1 to 1000;output;end;run;This example restarts a MultiLoad step that recorded checkpoints and failed afterloading 2000 rows of data.proc append data=trlib.load(TPT=YES MULTILOAD=YESTPT_RESTART=YES TPT_CHECKPOINT_DATA=2000)data=work.inputdata(FIRSTOBS=2001);run;Teradata Processing Tips <strong>for</strong> <strong>SAS</strong> UsersReading from and Inserting to the Same Teradata TableIf you use <strong>SAS</strong>/<strong>ACCESS</strong> to read rows from a Teradata table and then attempt toinsert these rows into the same table, you can hang (suspend) your <strong>SAS</strong> session.Here is what happens:3 a <strong>SAS</strong>/<strong>ACCESS</strong> connection requests a standard Teradata READ lock <strong>for</strong> the readoperation.3 a <strong>SAS</strong>/<strong>ACCESS</strong> connection then requests a standard Teradata WRITE lock <strong>for</strong> theinsert operation.3 the WRITE lock request suspends because the read connection already holds aREAD lock on the table. Consequently, your <strong>SAS</strong> session hangs (is suspended).Here is what happens in the next example:3 <strong>SAS</strong>/<strong>ACCESS</strong> creates a read connection to Teradata to fetch the rows selected(select *) from TRA.SAMETABLE, requiring a standard Teradata READ lock;Teradata issues a READ lock.3 <strong>SAS</strong>/<strong>ACCESS</strong> creates an insert connection to Teradata to insert the rows intoTRA.SAMETABLE, requiring a standard Teradata WRITE lock. But the WRITElock request suspends because the table is locked already by the READ lock.3 Your <strong>SAS</strong>/<strong>ACCESS</strong> session hangs.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!