Re: load SAS table into DB2 temporary table

Enclose SQL create and delete queries in a SQL EXECUTE() function and pass
them through to DB2. Once you have the table created, you can insert rows of
data (using BULKLOAD to speed up inserting large numbers of rows). Ask your
DB2 DBA about the correct syntax for DB2 temporary table name.

-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of tonts
Sent: Wednesday, June 30, 2004 2:31 PM
Subject: Re: load SAS table into DB2 temporary table


Thanks for your answer.
But the problem is a little bit different :

The DB2 table MUST BE a temporary table and can only be created into a PROC
SQL statment (strict instruction from my Data Base Administrator). And, at
the end of the Proc SQL statment (the "quit;" instruction), the DB2 table is
automatically delete. Therefore, I have to do all my manipulation inside a
PROC SQL statment...

Not very easy when I have to optimize the statments....

Thanks for everybody who will help me.


<lois831@hotmail.com> a �crit dans le message de
> Pascal,
> Creating a DBMS table using SQL INSERT statements is a very slow
> method and you don't need to write out your SAS dataset as a
> sequential file. Try using the LIBNAME statement to define your DB2
> database and then just create the table as if it were a regular SAS
> dataset. If you have a lot of data then you can use the BULKLOAD
> option to load all of the records.
> Here is an example:
> libname session db2 user=aaa password=bbb ssid=DB0N schema=ICMC; data
> session.client;
> run;
> or with BULKLOAD For a lot of data:
> data session.client(bulkload=yes);
> run;
> For more details feel free to read my SUGI paper
> http://www2.sas.com/proceedings/sugi29/106-29.pdf
> It refers to Oracle tables but most of it applies to DB2 as well. I
> hope you find it helpful.
> Lois Levin
HERMANS1 (2683)
6/30/2004 8:29:51 PM
comp.soft-sys.sas 142827 articles. 3 followers. Post Follow

0 Replies

Similar Articles

[PageSpeed] 39