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 (June 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 8 Jun 2004 12:19:27 -0500
Reply-To:   Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject:   Re: Proc SQL
Comments:   To: nicole.d.bibb@WELLSFARGO.COM
Content-Type:   text/plain; charset=us-ascii

The syntax isn't correct; that's why you're getting a message. There is an example in the PROC SQL documentation. At a minimum, you must provide an expression immediately after the CASE keyword, and a THEN for each WHEN. It's a good idea to provide an ELSE clause and a name for the the result. Something like

case 1 when cext0303 ne 'Z' then 1 else 2 end as myresult

It would help if you had posted the actual error message insted of making us guess what it might be. You might also save some time by at least glancing at the documentation before you ask a question - the documentation is pretty clear about what a case expression must look like.

-- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA

>>> "Nicole B" <nicole.d.bibb@WELLSFARGO.COM> 06/08/2004 10:08 AM >>> Not sure why this sql is not working correctly. I keep getting an error msg on the case statement.

proc sql; create view basel.join&date as select * , case when cext0303 not eq 'Z' end from worktst.mus&date left join worktst.mus&perdate on mus&date..acc_id=mus&perdate..acc_id; quit; proc freq data=basel.join&date; table cext0303 / missing list; proc print data=basel.join&date (obs=10); title "MERGED OBSMTH AND PERFMTH"; run;


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