<?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 Proc steps in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-steps/m-p/32272#M7749</link>
    <description>can we do a first. or last. in the proc step itself? if yes, then how?</description>
    <pubDate>Fri, 18 Jul 2008 09:46:29 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-07-18T09:46:29Z</dc:date>
    <item>
      <title>Proc steps</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-steps/m-p/32272#M7749</link>
      <description>can we do a first. or last. in the proc step itself? if yes, then how?</description>
      <pubDate>Fri, 18 Jul 2008 09:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-steps/m-p/32272#M7749</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-07-18T09:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc steps</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-steps/m-p/32273#M7750</link>
      <description>No, you can't. There "variables" are only available during a DATA step, when there is a BY statement.</description>
      <pubDate>Fri, 18 Jul 2008 10:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-steps/m-p/32273#M7750</guid>
      <dc:creator>Olivier</dc:creator>
      <dc:date>2008-07-18T10:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc steps</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-steps/m-p/32274#M7751</link>
      <description>Hi:&lt;BR /&gt;
  Olivier is right. First.BYVAR and Last.BYVAR only work for the DATA step. However, PROC REPORT gives you the ability to execute a COMPUTE block BEFORE a group or order variable and/or AFTER a group or order variable and this is the closest you would come to a similar ability in a PROC. So, for example, in PROC REPORT, if you wanted a running total of some variable, for each COUNTRY, then COUNTRY would be your GROUP variable and you might have something like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
compute before country;&lt;BR /&gt;
  runtot = 0;&lt;BR /&gt;
endcomp;&lt;BR /&gt;
compute sales;&lt;BR /&gt;
  runtot + sales.sum;&lt;BR /&gt;
endcomp;&lt;BR /&gt;
compute after country;&lt;BR /&gt;
   line 'The running total is: ' runtot dollar14. ' for ' country $15.;&lt;BR /&gt;
endcomp;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                    &lt;BR /&gt;
In this instance, the compute before country processing might be equivalent to what you do for an IF FIRST.BYVAR condition; and the compute after country processing might be equivalent to what you do for an IF LAST.BYVAR condition. Of course, what you can do here is limited to what you can do with PROC REPORT.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 18 Jul 2008 16:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-steps/m-p/32274#M7751</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-07-18T16:23:41Z</dc:date>
    </item>
  </channel>
</rss>

