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 (May 2011, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 27 May 2011 10:57:09 -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: Help on Do While Loop!
Comments:   To: "Bian, Haikuo" <HBian@FLQIO.SDPS.ORG>
In-Reply-To:   A<FA0550A1D186FF49BB0748CD711B17EDB2A9426FE4@SDPSMSX.QUALNET.ORG>
Content-Type:   text/plain; charset="us-ascii"

If you have an OUTPUT statement, this prevents data from being written to the dataset unless the OUTPUT is executed during this record's processing.

In this case the OUTPUT exists, but is never executed, so you have no data.

It's weird, but that's the way it is.

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Bian, Haikuo Sent: Friday, May 27, 2011 10:45 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Help on Do While Loop!

Dear List,

Please check out following code:

data test; b=2; do while (b>3); output; end; run;

proc print; run;

There is no observation in "test" table after running. However, if you comment out "output", then there will be a record written into "test" table. Question: As we know that "Do While" evaluates expression at the top of the loop, and skips loop when expression is false, so why supposedly NON-executed "output" statement makes such a difference?

Thanks, Haikuo

IMPORTANT WARNING: This electronic message transmission, and any documents accompanying it, contains information from Florida Medical Quality Assurance, Inc., which is intended for the individual or entity to whom it is addressed. This e-mail may contain information that is privileged and confidential, the disclosure of which is governed by applicable law. Disclosure of confidential information is prohibited by Federal regulations (42 CFR Part 480). If the reader of this e-mail is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, the reader is hereby notified that any dissemination, distribution or copying of this information is STRICTLY PROHIBITED. Unauthorized disclosure of confidential information is subject to Federal prosecution. If the reader has received this message in error, please notify the sender immediately by electronic mail and delete the related e-mail(s).

----------------------------------------- Email messages cannot be guaranteed to be secure or error-free as transmitted information can be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The Centers for Medicare & Medicaid Services therefore does not accept liability for any error or omissions in the contents of this message, which arise as a result of email transmission.

CONFIDENTIALITY NOTICE: This communication, including any attachments, may contain confidential information and is intended only for the individual or entity to which it is addressed. Any review, dissemination, or copying of this communication by anyone other than the intended recipient is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and delete and destroy all copies of the original message.


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