<?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: Conditionally passing control in a program in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69671#M20030</link>
    <description>Very interesting solutions. Many thanks to both of you.&lt;BR /&gt;
V</description>
    <pubDate>Fri, 03 Sep 2010 15:45:46 GMT</pubDate>
    <dc:creator>VD</dc:creator>
    <dc:date>2010-09-03T15:45:46Z</dc:date>
    <item>
      <title>Conditionally passing control in a program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69666#M20025</link>
      <description>Is there a way to pass the control from one part of the program to another, without the use of macros. I'm looking for something that would do a similar function as a 'go to' statement but is not restricted within one data step only.&lt;BR /&gt;
Thanks.</description>
      <pubDate>Fri, 03 Sep 2010 09:45:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69666#M20025</guid>
      <dc:creator>VD</dc:creator>
      <dc:date>2010-09-03T09:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally passing control in a program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69667#M20026</link>
      <description>Yes, you can use CALL EXECUTE with IF / THEN DO / END logic in a DATA step to cause later processing conditionally.  Suggest using the SAS support website for SAS-hosted DOC and supplemental technical / conference reference material.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
call execute data step site:sas.com

Message was edited by: sbb</description>
      <pubDate>Fri, 03 Sep 2010 12:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69667#M20026</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-09-03T12:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally passing control in a program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69668#M20027</link>
      <description>This is very helpful, thanks Sbb.&lt;BR /&gt;
&lt;BR /&gt;
I'm wondering if there is any function like the html anchor whereby you can anchor a position in the code. And then once any condition is true, all the code beyond that anchor point can be executed otherwise not. &lt;BR /&gt;
&lt;BR /&gt;
I understand that macros would make it simple to implement, but could it be done without the use of macros?&lt;BR /&gt;
Many thanks.&lt;BR /&gt;
V.</description>
      <pubDate>Fri, 03 Sep 2010 13:26:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69668#M20027</guid>
      <dc:creator>VD</dc:creator>
      <dc:date>2010-09-03T13:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally passing control in a program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69669#M20028</link>
      <description>Hi:&lt;BR /&gt;
  You might investigate the LINK statement:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/en/lrdict/63026/HTML/default/a000201972.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/en/lrdict/63026/HTML/default/a000201972.htm&lt;/A&gt; &lt;BR /&gt;
 &lt;BR /&gt;
SAS also still supports the GOTO statement -- although generally, I find that GOTO is not needed if you structure your program logic correctly, using DO--ELSE and IF--THEN--DO--ELSE DO--END constructions&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/en/lrdict/63026/HTML/default/a000201949.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/en/lrdict/63026/HTML/default/a000201949.htm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
And, as Scott says, CALL EXECUTE can place code in the program stack to execute when your "calling" data step program has ended. However, it really depends on what you want to do--CALL EXECUTE can execute program code (such as a PROC STEP) or could, but does not have to, invoke a macro program.&lt;BR /&gt;
             &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 03 Sep 2010 14:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69669#M20028</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-09-03T14:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally passing control in a program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69670#M20029</link>
      <description>not automatic, but effective:&lt;BR /&gt;
1  at start point of conditional code  open fileref, say, myRef &lt;BR /&gt;
2  push conditional code to myRef using the file statement MOD option in each subsequent data step&lt;BR /&gt;
3  once a decision to use the conditional code is made, %include that fileref with code like[pre]  data ;&lt;BR /&gt;
   if conditions = ready then do;&lt;BR /&gt;
    call execute( ' %include myRef /source2 ; ' ) ;&lt;BR /&gt;
   end ;&lt;BR /&gt;
run ;[/pre] the point being that %include in open code will be executed unconditionally, so wrap call execute() around it to apply your conditions.&lt;BR /&gt;
 &lt;BR /&gt;
good luck&lt;BR /&gt;
peterC</description>
      <pubDate>Fri, 03 Sep 2010 14:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69670#M20029</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-09-03T14:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally passing control in a program</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69671#M20030</link>
      <description>Very interesting solutions. Many thanks to both of you.&lt;BR /&gt;
V</description>
      <pubDate>Fri, 03 Sep 2010 15:45:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Conditionally-passing-control-in-a-program/m-p/69671#M20030</guid>
      <dc:creator>VD</dc:creator>
      <dc:date>2010-09-03T15:45:46Z</dc:date>
    </item>
  </channel>
</rss>

