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 (August 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 17 Aug 2004 12:15:52 -0700
Reply-To:   "Pardee, Roy" <pardee.r@GHC.ORG>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Pardee, Roy" <pardee.r@GHC.ORG>
Subject:   Re: Odd SQL error
Comments:   To: Richard Read Allen <peakstat@WISPERTEL.NET>
Content-Type:   text/plain; charset="us-ascii"

Upper & Lower are reserved keywords in sql--they do the same thing as UpCase and LowCase (but apparently *way* less efficiently--see the past thread "What the heck us UPPER()?"). Change those var names & you're in good shape. Nasty, that one...

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Richard Read Allen Sent: Tuesday, August 17, 2004 12:10 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Odd SQL error SQL heads, I've come to really like using SQL when it suits my purposes, which it does quite a bit, but every once in a while I run across an error that I do not understand. Below is an illustration of one I've been getting today that's been bugging the $# *^ out of me. data diffs; input tmt _tmt Estimate Lower Upper; cards; 1 2 -0.5758 -1.8622 0.7105 1 3 0.2881 -1.0045 1.5808 2 3 0.8640 -0.4646 2.1925 proc sql; create table Diffs_CIs as select tmt , _tmt, put(-1*Estimate,8.1) as Difference, put(-1*Upper,5.2)||','||put(-1*Lower,5.2) as CI from Diffs; quit; When this is run I get the error below in my log which I can't understand why it's occurring. If the last line of the select clause is removed it runs fine. Further, if one just replaces this last line with

put(-1*Upper,5.2) as CI the exact same error occurs. Why does this error occur in one case and not in the other? Estimate and Upper are both numeric variables. I'm probably overlooking something real simple, but it's escaped me. Thanks, Richard _____

NOTE: SAS (r) Proprietary Software Release 8.2 (TS2M0) 9 proc sql; 10 create table Diffs_CIs as 11 select tmt , _tmt, 12 put(-1*Estimate,8.1) as Difference, 13 put(-1*Upper,5.2)||','||put(-1*Lower,5.2) as CI _ 79 76 ERROR 79-322: Expecting a (. ERROR 76-322: Syntax error, statement will be ignored. 14 from Diffs; _____

70 put(-1*Upper,5.2) as CI - 79 76 ERROR 79-322: Expecting a (. ERROR 76-322: Syntax error, statement will be ignored.

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