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 (July 2012, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 9 Jul 2012 17:05:35 -0400
Reply-To:     Bolotin Yevgeniy <YBolotin@SCHOOLS.NYC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Bolotin Yevgeniy <YBolotin@SCHOOLS.NYC.GOV>
Subject:      Re: multiple semicolons in IF and SELECT statements
In-Reply-To:  <DCCF5C4C413228459F79656548489F6D095B1C153C@EX3VS1.nyced.org>
Content-Type: text/plain; charset="us-ascii"

Tom Abernathy did make a good point (offline) that if I can't decide how I want to use it, I should wrap the macro call into a "do; end;" on the outside, and then I can put my semicolons anywhere I want.

So I guess I'll just have to do that.

if a then do; i = 5;; end; else i = 6;

select (a); when (3) do; i=5;; end; otherwise; end;

From: Bolotin Yevgeniy Sent: Monday, July 09, 2012 1:45 PM To: SAS-L@LISTSERV.UGA.EDU Subject: multiple semicolons in IF and SELECT statements

Ran into the "macro code breaks SELECT statement" issue

Dug around for a bit, found that having a trailing semicolon in the macro + a semicolon after the call was what was causing it (i.e. "when (3) %_z(5);" )

So, question:

Is it possible to force the compiler to ignore the extra semis in code like this? (both cause syntax errors)

if a then i = 5;; else i = 6;

Or

select (a); when (3) i=5;; otherwise; end;

(a full-statement macro without a trailing semicolon just looks *weird* to me, as does a macro invocation without a trailing semicolon)


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