<?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 Data Step Events in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Events/m-p/89598#M19006</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first simply what i am looking for is a way to execute a static peice of code after every data step / proc step completes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I &lt;STRONG&gt;do not&lt;/STRONG&gt; want to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA D1;&lt;/P&gt;&lt;P&gt;/*Code*/&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;%StaticMacro;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA D2;&lt;/P&gt;&lt;P&gt;/*Code*/&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;%StaticMacro;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather i want to find a way to affect the processing of a data step like you would with application programming, using events.&lt;/P&gt;&lt;P&gt;so i need to find the event that is called just after the data step has finished, a common coded example is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub ABC_Finished()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there such a way to affect processing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Dec 2012 06:12:34 GMT</pubDate>
    <dc:creator>MaheshvaranP</dc:creator>
    <dc:date>2012-12-04T06:12:34Z</dc:date>
    <item>
      <title>Data Step Events</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Events/m-p/89598#M19006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first simply what i am looking for is a way to execute a static peice of code after every data step / proc step completes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I &lt;STRONG&gt;do not&lt;/STRONG&gt; want to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA D1;&lt;/P&gt;&lt;P&gt;/*Code*/&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;%StaticMacro;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA D2;&lt;/P&gt;&lt;P&gt;/*Code*/&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;%StaticMacro;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather i want to find a way to affect the processing of a data step like you would with application programming, using events.&lt;/P&gt;&lt;P&gt;so i need to find the event that is called just after the data step has finished, a common coded example is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub ABC_Finished()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there such a way to affect processing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 06:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Events/m-p/89598#M19006</guid>
      <dc:creator>MaheshvaranP</dc:creator>
      <dc:date>2012-12-04T06:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step Events</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Events/m-p/89599#M19007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there such a way? Not that I knew. (As if that meant a lot&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However you could create a macro replacement to the RUN and QUIT statement respectively.&lt;/P&gt;&lt;P&gt;Somewhat like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro static_macro ( called_after = NONE ) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %put &amp;amp;sysmacroname called after &amp;amp;called_after ;&lt;/P&gt;&lt;P&gt; %mend static_macro ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %macro rq (rq_cmd) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %local _sp ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let _sp = &amp;amp;sysprocname ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;rq_cmd ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %static_macro ( called_after = &amp;amp;_sp ) ;&lt;/P&gt;&lt;P&gt; %mend rq ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data _null _ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'Note: Message from datastep.' ;&lt;/P&gt;&lt;P&gt; %rq ( run ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; proc sql noprint ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select max(age) as max_age from sashelp.class ;&lt;/P&gt;&lt;P&gt; %rq ( quit ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So not an EVENT like solution, much rather a workaround.&lt;/P&gt;&lt;P&gt;BTW: you could get fancier by using automatic macro variable &amp;amp;SYSPROCNAME but I think coding RUN/QUIT as an argument of the RQ macro enhances readability.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 09:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Events/m-p/89599#M19007</guid>
      <dc:creator>Robert_Bardos</dc:creator>
      <dc:date>2012-12-04T09:51:36Z</dc:date>
    </item>
  </channel>
</rss>

