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 (March 1999, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 12 Mar 1999 21:14:47 -0500
Reply-To:   hermans1 <hermans1@WESTAT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   hermans1 <hermans1@WESTAT.COM>
Subject:   Re: SQL JOIN - Still having problems.
Comments:   To: Dianne Brooks <dbrooks@GAES.GRIFFIN.PEACHNET.EDU>
Content-Type:   text/plain; charset=US-ASCII

Try

PROC SQL; CREATE TABLE ALL2 AS SELECT A.YR AS YR,A.EN AS EN,A.REP AS REP,A.A,A.B,COALESCE(A.C,P.C) FROM ALL A, NEWP P WHERE A.YR=P.YR AND A.EN=P.EN AND A.REP=P.REP ;

The COALESCE() function takes the first value unless missing, else the 2nd value. Sig ______________________________ Reply Separator _________________________________ Subject: SQL JOIN - Still having problems. Author: Dianne Brooks <dbrooks@GAES.GRIFFIN.PEACHNET.EDU> at Internet-E-Mail Date: 3/12/99 5:22 PM

Thank you, Robert Abelson Ian Whitlock, couldn't get over the quick response time.

You've gotten me along a little father... but I still can't figure out how to replace ONLY the missing values in C with the predicted value of C.

PROC GLM NOPRINT DATA = ALL;BY YR; CLASSES EN REP; MODEL A B C = EN REP; OUTPUT OUT = NEWP PREDICTED = PA PB PC; RUN;

PROC SQL; CREATE TABLE ALL2 AS SELECT A.YR, P.YR, A.EN, P.EN, A.REP, P.REP, A.A, A.B, A.C, P.C FROM ALL A, NEWP P WHERE A.YR=P.YR AND A.EN=P.EN AND A.REP=P.REP; SELECT YR, EN, REP, A, C, A.C, P.C FROM ALL2;

Thanks, Dianne


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