<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Program step count in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635653#M188763</link>
    <description>&lt;P&gt;The&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;creates a step boundary, unless you have a procedure that supports run-group processing, like DATASETS or DS2.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;also create a step boundary, &lt;EM&gt;if a step is "active"&lt;/EM&gt; (not yet finished). Since you have run statements for every step, the following data or proc statements do not create a new boundary, and you have three steps.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=sashelp.class;
run;
run;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is a single step, followed by two run statements that do nothing.&lt;/P&gt;
&lt;P&gt;A datalines block in a data step also creates a step boundary, as you can't have any data step statements after the datalines block.&lt;/P&gt;</description>
    <pubDate>Sun, 29 Mar 2020 15:48:27 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-03-29T15:48:27Z</dc:date>
    <item>
      <title>Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635652#M188762</link>
      <description>&lt;P&gt;Working through the SAS Certified Specialist Guide. The book says the last PROC PRINT is the 3rd and last step. From reading the text book, I thought this would have 6 statements with each RUN; being counted as a step. The explanation in the textbook doesn't make sense to me. Can anyone please explain why this code example only has 3 steps?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data user.tables; 
  set work.jobs;run;  
proc sort data=user.tables;  
  by name;  run;  
proc print data=user.tables;  
run;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Mar 2020 15:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635652#M188762</guid>
      <dc:creator>DavidBrown</dc:creator>
      <dc:date>2020-03-29T15:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635653#M188763</link>
      <description>&lt;P&gt;The&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;creates a step boundary, unless you have a procedure that supports run-group processing, like DATASETS or DS2.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;also create a step boundary, &lt;EM&gt;if a step is "active"&lt;/EM&gt; (not yet finished). Since you have run statements for every step, the following data or proc statements do not create a new boundary, and you have three steps.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=sashelp.class;
run;
run;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is a single step, followed by two run statements that do nothing.&lt;/P&gt;
&lt;P&gt;A datalines block in a data step also creates a step boundary, as you can't have any data step statements after the datalines block.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 15:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635653#M188763</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-29T15:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635659#M188764</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; Thank you for the explanation. Your break down makes sense. However, I was confused by the example below from the text, in which it labels the "run" after "data" as a separate step (Step #3). Why isn't that "run" considered part of the "data" step. In essence, why is this considered to have 4 steps and not 3 vs. my original post, which is said to have 3 steps. The code in my original post, the "data" step is the first step, and includes the "run". This seems contradictory to my SAS beginner's mind.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;title1 'June Billing';        /*#1*/
data work.junefee;            /*#2*/  
set cert.admitjune;  
where age&amp;gt;39;
run;                          /*#3*/
proc print data=work.junefee; /*#4*/&lt;BR /&gt;run;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Mar 2020 16:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635659#M188764</guid>
      <dc:creator>DavidBrown</dc:creator>
      <dc:date>2020-03-29T16:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635660#M188765</link>
      <description>&lt;P&gt;Actually it's quite simple (just to rephrase Kurt Bremser's reply):&lt;/P&gt;
&lt;P&gt;Roughly speaking, a DATA step looks like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ...;
...
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and a PROC step looks like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc ...;
...
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or, for a few procedures, like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc ...;
...
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So, this simplified ("first-lesson like") statement already provides the answer to your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notable exceptions (not applicable to your example) are&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;DATA steps with datalines: The RUN statement is optional for them, not required.&lt;/LI&gt;
&lt;LI&gt;DATA or PROC steps whose closing RUN (or QUIT) statement is omitted for brevity because it's implied by the beginning of a new step (i.e., a subsequent DATA or PROC statement).&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Sun, 29 Mar 2020 16:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635660#M188765</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-03-29T16:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635661#M188766</link>
      <description>&lt;P&gt;@FreelanceReinhard Thank you. I'm starting to get it, but still don't get, why in my second example "run;" in step 3 is considered and individual step. Why is it not part of the data step? Sorry if I am being obtuse.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 17:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635661#M188766</guid>
      <dc:creator>DavidBrown</dc:creator>
      <dc:date>2020-03-29T17:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635664#M188767</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301357"&gt;@DavidBrown&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; Thank you for the explanation. Your break down makes sense. However, I was confused by the example below from the text, in which it labels the "run" after "data" as a separate step (Step #3). Why isn't that "run" considered part of the "data" step. In essence, why is this considered to have 4 steps and not 3 vs. my original post, which is said to have 3 steps. The code in my original post, the "data" step is the first step, and includes the "run". This seems contradictory to my SAS beginner's mind.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;title1 'June Billing';        /*#1*/
data work.junefee;            /*#2*/  
set cert.admitjune;  
where age&amp;gt;39;
run;                          /*#3*/
proc print data=work.junefee; /*#4*/&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;From my POV, that is flat wrong. These are two(!) steps and a single &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsglobal&amp;amp;docsetTarget=titlepage.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;Global Statement&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 17:11:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635664#M188767</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-29T17:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635665#M188768</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;From my POV, that is flat wrong. These are two(!) steps and a single &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsglobal&amp;amp;docsetTarget=titlepage.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;Global Statement&lt;/A&gt;.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Exactly. The assignment of a separate number to the global TITLE1 statement clearly indicates that these numbers do &lt;EM&gt;not&lt;/EM&gt; count &lt;EM&gt;steps&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, the fact that an &lt;EM&gt;omitted&lt;/EM&gt; RUN (or QUIT) statement can be "implied" by the beginning of a new step (as I mentioned earlier) does &lt;EM&gt;not&lt;/EM&gt; mean that the combination of a mere RUN (or QUIT) statement &lt;EM&gt;and&lt;/EM&gt;&amp;nbsp;the beginning of a new step constitutes two steps.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 17:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635665#M188768</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-03-29T17:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635666#M188769</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; Thank you. I thought I was going crazy. In essence they are saying there is a difference between these 2 steps below, when there isn't.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;**Example #1 (one step)**;&lt;BR /&gt;data user.tables;   
  set work.jobs;run; 

**Example #2 (two steps)**;&lt;BR /&gt;data work.junefee;            
  set cert.admitjune;  &lt;BR /&gt;  where age&amp;gt;39;&lt;BR /&gt;run;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Mar 2020 17:27:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635666#M188769</guid>
      <dc:creator>DavidBrown</dc:creator>
      <dc:date>2020-03-29T17:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635669#M188771</link>
      <description>&lt;P&gt;@FreelanceReinhard The text considers the global statement as an "outside" step, but a step nonetheless.&lt;BR /&gt;Per the SAS Certified Specialist Prep Guide Chapter 2:&lt;BR /&gt;1 The TITLE statement is a global statement. Global statements are typically outside steps and do not require a RUN statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is their explanation on why my first example as 3 steps. However, from my POV I still don't see why:&lt;/P&gt;&lt;P&gt;When it encounters a DATA, PROC, or RUN statement, SAS stops reading statements and executes the previous step in the program. This program contains one DATA step and two PROC steps, for a total of three program steps.&lt;/P&gt;&lt;P&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 17:40:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635669#M188771</guid>
      <dc:creator>DavidBrown</dc:creator>
      <dc:date>2020-03-29T17:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635670#M188772</link>
      <description>&lt;P&gt;A global statement is NEVER a step. See the definition of "step" by SAS themselves:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;What are the components of a SAS program?&lt;/H2&gt;
&lt;DIV id="chatbot_intro"&gt;A SAS program is a sequence of steps that you submit to SAS for execution. Each step in the program performs a specific task. &lt;STRONG&gt;Only two kinds of steps make up SAS programs: DATA steps and PROC steps&lt;/STRONG&gt;.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;(from&amp;nbsp;&lt;A href="https://support.sas.com/software/products/university-edition/faq/programs_components.htm" target="_blank" rel="noopener"&gt;https://support.sas.com/software/products/university-edition/faq/programs_components.htm&lt;/A&gt;, emphasis by me)&lt;/DIV&gt;</description>
      <pubDate>Sun, 29 Mar 2020 17:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635670#M188772</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-29T17:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635672#M188773</link>
      <description>Thanks for taking the time to answer my question. Initially, my answer to my initial question was that there were 3 steps. But when I referred back to the chapter content to be sure, I saw them label "run;" as it's own step. Then, they called a Global Statement a step, albeit an "outside step".&lt;BR /&gt;&lt;BR /&gt;Appreciate your input very much.</description>
      <pubDate>Sun, 29 Mar 2020 17:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635672#M188773</guid>
      <dc:creator>DavidBrown</dc:creator>
      <dc:date>2020-03-29T17:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635677#M188776</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301357"&gt;@DavidBrown&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;(...) Global statements are typically outside steps ...&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well, English is not my native language, but I understand this sentence like "Global statements are typically (used) outside &lt;STRONG&gt;of&lt;/STRONG&gt; steps." (But for some global statements, e.g., TITLE statements, it's not uncommon to use them inside [of] steps.) There is no such thing as an "outside step" -- only DATA and PROC steps.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 19:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635677#M188776</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-03-29T19:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Program step count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635681#M188777</link>
      <description>@FreelanceReinhard I think you are correct here and before about the numbering. That example was straight from the text. They were explaining steps, then gave that example. I assumed the numbers were steps, when they were not. The devil was in the details here, which is what I am finding in SAS documentation. It may be technically correct, but it is not very clear. It appears to be written as a reference for somebody who already knows the language, rather than for someone learning it.</description>
      <pubDate>Sun, 29 Mar 2020 18:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-step-count/m-p/635681#M188777</guid>
      <dc:creator>DavidBrown</dc:creator>
      <dc:date>2020-03-29T18:20:44Z</dc:date>
    </item>
  </channel>
</rss>

