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 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 26 Jan 2004 14:24:06 -0500
Reply-To:   Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject:   Re: how-to stop datasteps if nobs=0 in macro

You have had some good suggestions.

A simple tool, useful in such situations, is the CANCEL option of the RUN statement. Basically, the idea is to code

run &cancelswitch;

so that a step can be toggled on or off by manipulating the value of the macrovariable (to blank or "CANCEL").

On Sun, 25 Jan 2004 13:30:45 +0200, Arto Raiskio <arto-nospam@RAISKIO.COM> wrote:

>I have some macrocode which looks like the following sample and the question >is how to best stop the code so that the proc printto is not executed and >Zero byte reports files written (empty report files) > >code runs on windows, sas is version 9 > >%macro something; >data....(a datastep) >proc ..(some procstep) > >proc printto file= (this would write output to a file if records exist) >%mend; > >normally, on a mainframe job, one could use something like > >data _null_;set a nobs=nobs; if nobs=0 then abort abend 0001;run; > >what might be the easiest way to stop the macro just before the proc printto >?


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