|
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
|