<?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: Enterprise Guide: conditional processing removed when exporting code in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/573728#M34226</link>
    <description>&lt;P&gt;As you all noted, conditional logic added to a process flow does not currently get exported as SAS code.&amp;nbsp; Manually coding conditional logic (as suggested) is the closest solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Casey&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jul 2019 02:50:38 GMT</pubDate>
    <dc:creator>CaseySmith</dc:creator>
    <dc:date>2019-07-16T02:50:38Z</dc:date>
    <item>
      <title>Enterprise Guide: conditional processing removed when exporting code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/569728#M34082</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added conditional processing to a program in a process flow based on the day of the month: the program should execute on the 2nd day of the month only. This works without problems when running the code from within Enterprise Guide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, now I have exported the code to a .sas file and scheduled it to run in a batch process and the condition seems to be ignored during the export. I cannot track it in the execution log and also in the created .sas file I cannot find traces of it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me on this please? Your help is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 09:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/569728#M34082</guid>
      <dc:creator>barry_van_dijk</dc:creator>
      <dc:date>2019-06-28T09:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide: conditional processing removed when exporting code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/570706#M34106</link>
      <description>Is it possible that your conditional processing is done in scheduler rather than SAS syntax itself?  Another way SEG allows for conditional processing is via interactive user input.  Can't tell how you programmed the conditional processing you're referencing.&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Jul 2019 19:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/570706#M34106</guid>
      <dc:creator>Haris</dc:creator>
      <dc:date>2019-07-02T19:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide: conditional processing removed when exporting code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/571179#M34121</link>
      <description>&lt;P&gt;Hello Haris,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interactive user input you mentioned is not an option as the program is running as a batch in the Windows scheduler, so I cannot perform any user interaction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program just queries a database and sends an e-mail with the query results as an Ecxel attachment (see the code fragment below):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql exec; 
	connect to odbc(datasrc="&amp;lt;datasource&amp;gt;" USER="&amp;lt;user&amp;gt;" PASSWORD="&amp;lt;password&amp;gt;"); 

	create table work.&amp;lt;dataset&amp;gt; as 
	select *
	from connection to odbc(


select
	...
from
	...
where
	...
;


)
	;

	disconnect from odbc; 
	quit; 
run; 

proc export 
data=work.&amp;lt;dataset&amp;gt;
outfile="&amp;lt;file path&amp;gt;"
dbms=xlsx replace;
run;

options emailsys = SMTP;
options emailhost = "&amp;lt;e-mail host&amp;gt;";
options emailauthprotocol = NONE;

filename anyname email
  to="&amp;lt;e-mail address&amp;gt;"
  from="&amp;lt;e-mail address&amp;gt;"
  sender="&amp;lt;e-mail address&amp;gt;"
  subject="&amp;lt;subject&amp;gt;"
  attach=("&amp;lt;file path&amp;gt;" content_type="application/xlsx");

data _null_;
 file anyname;
 put '&amp;lt;mail body&amp;gt;';
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In attached zip file you will find a screenshot showing the way that the condition was added to the process flow. However, when exporting the program, this condition seems to be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you know another way to implement the condition in such a way that it gets included in the exported code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Barry&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 08:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/571179#M34121</guid>
      <dc:creator>barry_van_dijk</dc:creator>
      <dc:date>2019-07-04T08:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide: conditional processing removed when exporting code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/571284#M34122</link>
      <description>&lt;DIV&gt;&lt;FONT style="background-color: #ffffff;"&gt;I just did some experimenting, and I can't see any way to get the conditional logic into the exported SAS code.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT style="background-color: #ffffff;"&gt;However, in the program that I am running conditionally, after I've run it, there is a tab called "Conditional Logic Log". It shows how EG transitions between your specified condition and a flag that EG uses to decide whether to run the program.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT style="background-color: #ffffff;"&gt;If you're comfortable with macro logic, you should be able to use that to derive the code that you need. If not, post it here and someone will be able to give you an example.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT style="background-color: #ffffff;"&gt;Tom&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Jul 2019 20:20:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/571284#M34122</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2019-07-04T20:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide: conditional processing removed when exporting code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/571328#M34123</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found the following lines in the project log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          data _NULL_; rc = 0;
4          if day(date()) = day('2jun2019'd) then
5             rc = 1;
6          CALL SYMPUT('_egrc', PUT(rc,1.));
7          stop;
8          run;

NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

9          
10         QUIT; RUN;
11         &lt;/PRE&gt;&lt;P&gt;Is this what you are referring to?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I am not comfortable with macro logic at all, I would be very happy if someone could help me further on this!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Barry&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 07:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/571328#M34123</guid>
      <dc:creator>barry_van_dijk</dc:creator>
      <dc:date>2019-07-05T07:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide: conditional processing removed when exporting code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/571405#M34132</link>
      <description>&lt;P&gt;Yes, that's exactly what I was asking about!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this should do what you need; just put the code that you want executed conditionally between the %if and the %end statements (I used a proc print step).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _NULL_;
	rc = 0;

	if day(date()) = day('2jun2019'd) then
		rc = 1;
	CALL SYMPUT('DateFlag', PUT(rc,1.));
	stop;
run;

%if &amp;amp;DateFlag = 1 %then %do;

/* Code to be run conditionally */

proc print data=sashelp.class;
run;

%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jul 2019 14:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/571405#M34132</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2019-07-05T14:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide: conditional processing removed when exporting code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/571969#M34143</link>
      <description>&lt;P&gt;Thank you for your reply Tom! This works for me...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Barry&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/571969#M34143</guid>
      <dc:creator>barry_van_dijk</dc:creator>
      <dc:date>2019-07-09T08:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide: conditional processing removed when exporting code</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/573728#M34226</link>
      <description>&lt;P&gt;As you all noted, conditional logic added to a process flow does not currently get exported as SAS code.&amp;nbsp; Manually coding conditional logic (as suggested) is the closest solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Casey&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 02:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Enterprise-Guide-conditional-processing-removed-when-exporting/m-p/573728#M34226</guid>
      <dc:creator>CaseySmith</dc:creator>
      <dc:date>2019-07-16T02:50:38Z</dc:date>
    </item>
  </channel>
</rss>

