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 (October 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 11 Oct 2007 10:18:51 -0400
Reply-To:     "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject:      Re: Macro within Select Statment not Working

On Thu, 11 Oct 2007 09:45:47 -0400, Jack Clark <JClark@CHPDM.UMBC.EDU> wrote:

>Ernest, > >Thank you for the solution. It seems that the problem was my >semi-colons at the end of each macro call. > >Just trying to understand more....why did the extra semi-colon cause a >problem in the Select statement? Is it because once the END; statement >is encountered, the next thing has to be either WHEN, END or OTHERWISE >(not a semi-colon)? > >Thank again. > >Jack Clark >Research Analyst >Center for Health Program Development and Management >University of Maryland, Baltimore County

[snip]

I would call it a bug. It's an exception to the general rule that null statements (extraneous semicolons) are harmless at statement boundaries.

Also, it's quite odd that the null statement causes this problem but comments and global statements can be placed between the elements of a SELECT without raising an ERROR.

My experiments:

data _null_; select (1); when (1) put 'Duh'; ; otherwise put 'This should never appear.'; end; run;

data _null_; select (1); when (1) put 'Duh'; * ; otherwise put 'This should never appear.'; end; run;

data _null_; select (1); when (1) put 'Duh'; title; otherwise put 'This should never appear.'; end; run;

Only the first step fails.


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