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 (January 2011, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 14 Jan 2011 10:10:38 -0500
Reply-To:   Arthur Tabachneck <art297@ROGERS.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Arthur Tabachneck <art297@ROGERS.COM>
Subject:   Re: Can someone with 9.1 or earlier test this code?
Comments:   To: Chris Brooks <Chris.Brooks@ONS.GOV.UK>

Toby, Chris and everyone who responded offline, thanks and very much appreciated!

On 9.2 the same code produces:

ERROR: There is no matching %IF statement for the %THEN. A dummy macro will be compiled. 214 %let x="F"; 215 %end; 216 %mend test; 217 %test ('B') - 180 WARNING: Apparent invocation of macro TEST not resolved. ERROR 180-322: Statement is not valid or it is used out of proper order.

While I agree that error checking is important, I thought that SAS always ensured that previous code would continue to work. This is the second such discrepancy with that rule I've seen this week. Proc import using Excel as the DBMS on 64 bit systems was the other.

Art -------- On Fri, 14 Jan 2011 10:02:18 -0500, Chris Brooks <Chris.Brooks@ONS.GOV.UK> wrote:

>Art > >This code runs on 9.1.3 SP4 - no errors, notes or warnings and outputs "F" >to the log. > >Chris Brooks >Office for National Statistics >United Kingdom > >On Fri, 14 Jan 2011 09:51:21 -0500, Arthur Tabachneck <art297@ROGERS.COM> >wrote: > >>If I correctly understood the discussion, a couple of our list's members >>suggested that code, like the following, would work with 9.1 and earlier, >>but not with 9.2. Does it work with 9.1 and/or earlier versions? >> >>%global x; >>%macro test (something); >> %if &something. eq 'A' %then %do; >> data want; >> set sashelp.class (where=(sex eq 'M')); >> %let x="M"; >> run; >> %end; >> %else %then %do; >> %let x="F"; >> %end; >>%mend test; >>%test ('B') >>%put &x.; >> >>Thanks in advance, >>Art

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