LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 19 Oct 2010 16:59:32 -0500
Reply-To:   Craig Johnson <cjohns38@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Craig Johnson <cjohns38@GMAIL.COM>
Subject:   Re: PROC SQL Update Question
Comments:   To: Joe Matise <snoopy369@gmail.com>
In-Reply-To:   <AANLkTi=JPR7KS+t7mLpJWrdEqdXc7+ODBgAbDFXAN9MZ@mail.gmail.com>
Content-Type:   text/plain; charset=ISO-8859-1

Hi Joe,

Thanks for the quick reply and the detailed response. These sort of responses make it helpful for us budding SAS users.

It looks like my big error was putting the group by before the where (I think) and not including a check to make sure that the ID exists. I looked at SAS's example and kind of blew past but but you defiantly only want to update if they exist. Below is the final code I used. Note that I used a little different method for checking for the ID.

Thanks again for the help!

proc sql; UPDATE CALIBRATION_TRANS AS A SET Max_Trial= ( ( SELECT MAX(CalibrationBlock_Sample) FROM Split_char_calibrationblock AS B WHERE A.SUBJECT=B.SUBJECT Group by Subject)) WHERE A.Subject In(Select Subject From Split_char_calibrationblock); QUIT;


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