Date: Wed, 30 May 2012 12:12:21 +0000
Reply-To: "Burgess, Otto" <OBurgess@ATPCO.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Burgess, Otto" <OBurgess@ATPCO.NET>
Subject: Re: difference between run statement and quit in sas
In-Reply-To: <C619B53E21F245C6B7A8B65802C7CB45@D1871RB1>
Content-Type: text/plain; charset="us-ascii"
At one point I, as I recall, they were going to force the use of the run statement on z/os batch, but never did
I have found it interesting over the years, the exceptions to the rule in SAS, such as in the input statement, there are other exceptions
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Nat Wooding
Sent: Tuesday, May 29, 2012 9:37 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: difference between run statement and quit in sas
Paul
This is something that probably should be discussed every few months for the benefit of the newer members of the list.
Having been a main frame batch programmer for decades, I eschewed run statements for quite a while since they simply weren't needed in that environment. Now that I am totally in the PC world, I go back and add them when I see that I have ended a data or proc step and omitted the Run. As you say, a semicolon at the end of a group of data cards acts as a Run but I have developed the habit of using one there rather than the semicolon. The point about Run Cancel not working in that situation is very good to bring out.
Nat
-----Original Message-----
From: Choate, Paul@DDS [mailto:Paul.Choate@dds.ca.gov]
Sent: Tuesday, May 29, 2012 8:15 PM
To: Nat Wooding; SAS-L@LISTSERV.UGA.EDU
Subject: RE: difference between run statement and quit in sas
Hey Nat (& MahiSAS369) -
You probably also know that you don't need RUN if you use a cards/datalines statement in a data step. In that case SAS implies a boundary without any other code:
data;
input x;
cards;
1
;
Similar to statements within interactive procedures, the final semi-colon
here acts like a "run" command. Not that it matters much, but something
like RUN CANCEL; doesn't work where data is input inline.
Another implied boundary happens with an ENDSAS global statement. There must be other special cases.
It's good to understand that while QUIT ceases an active procedure that has already done its work, RUN (or a step boundary) causes SAS to process the preceding DATA step or PROC.
Of course, decent programming style dictates that you always use RUN or QUIT when appropriate, even though SAS will imply them at boundaries.
Hope that helps...
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Nat Wooding
Sent: Wednesday, May 09, 2012 6:21 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: difference between run statement and quit in sas
The run statement is used to cause a preceeding proc or data step to execute by defining a boundary on the step. This automatically happens to each proc or data step as the next step is encountered but if you simply ran the code
Proc Print;
Nothing would happen since a step boundary has not been reached. The one exception to this rule is if the proc or data step was the last code in a batch submitted job.
Quit statements are use to stop the running of a small set of Procs that continue to run until otherwise stopped. This includes SQL, some or all of the graphics procs, and, if memory serves, datastep.
Nat Wooding
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of SUBSCRIBE SAS-L Anonymous
Sent: Wednesday, May 09, 2012 9:02 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: difference between run statement and quit in sas
Hi ALL,
please help me
what is difference between run statement and quit in sas