LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 6 Dec 2006 20:08:10 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: looping and merging problem
Comments: To: siddharth_jain@MERCK.COM
In-Reply-To:  <>
Content-Type: text/plain; format=flowed

Siddharth ,

Use a SQL pass through ( it will force the join to be done on the oracle side) with following code:

Create Table Need As Select A.* , B.Col4 , B.Col5 , B.Col6 , B.Col7 , B.Col8 , B.Col9 , B.Col10 From Tabel1 As A Left Join Table2 As B On A.Serial_No = B.Serial_No ;

Toby Dunn

Quickly, bring me a beaker of wine, so that I may wet my mind and say something clever. Aristophanes

Wise people, even though all laws were abolished, would still lead the same life. Aristophanes

You should not decide until you have heard what both have to say. Aristophanes

From: Siddharth Jain <siddharth_jain@MERCK.COM> Reply-To: Siddharth Jain <siddharth_jain@MERCK.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: looping and merging problem Date: Wed, 6 Dec 2006 15:01:16 -0500

I have two tables

table 1 -- 30 thousand rows ======== serial_no col1 col2 col3

table 2 -- 5 million rows ======= serial_no col4 col5 col6 col7 col8 col9 col10

Data for both the tables comes from Oracle. I can't do a merge because then I will have to extract all the data from table 2, before merge - Oracle gives a fetch error record in this case.

The output table should return all 10 columns only for serial_no present in table 1 - 30 thousand rows as output.

I want to loop through table 1 and for every serial_no in table 1, I want to get corresponding records from table 2. Pls guide on how can this be done.

Thanks in advance, Siddharth

_________________________________________________________________ MSN Shopping has everything on your holiday list. Get expert picks by style, age, and price. Try it!,ptnrid=176,ptnrdata=200601&tcode=wlmtagline

Back to: Top of message | Previous page | Main SAS-L page