<?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: Stop DI job for blank data set in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340446#M10107</link>
    <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; I needed some more direction so had to post a new thread as it could be that I am approaching this incorrectly. Very new to writing on the fly SAS code so need more direction on this,</description>
    <pubDate>Mon, 13 Mar 2017 15:06:52 GMT</pubDate>
    <dc:creator>Aidan</dc:creator>
    <dc:date>2017-03-13T15:06:52Z</dc:date>
    <item>
      <title>Stop DI job for blank data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340411#M10101</link>
      <description>&lt;P&gt;I have a job that will check if a certain date exists in a data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it does I want the next few nodes of the job to execute, if not I want the job to stop completely.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can this be done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Aidan&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 13:38:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340411#M10101</guid>
      <dc:creator>Aidan</dc:creator>
      <dc:date>2017-03-13T13:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Stop DI job for blank data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340421#M10102</link>
      <description>&lt;P&gt;Ca you use SAS code? &amp;nbsp;If so:&lt;BR /&gt;%if %sysfunc(fileexists(...)) %then %do;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or sort data nodupkey to create a dataset, then check sashelp.vtable:&lt;BR /&gt;data _null_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set sashelp.vtable (where=(libname="&amp;lt;libname&amp;gt;" and memname="&amp;lt;dataset&amp;gt;" and nobs &amp;gt; 0));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; call execute('%include &amp;lt;next job&amp;gt;';);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will only call the execute if more than 0 obs.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 14:04:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340421#M10102</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-03-13T14:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Stop DI job for blank data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340427#M10103</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;example would certainly work programming wise, but it's not really DI Studio best practice...&lt;/P&gt;
&lt;P&gt;You could&amp;nbsp;use the same logic with an Extract, and have that as output to a Loop. No entries in the look up table, no loops.&lt;/P&gt;
&lt;P&gt;Another option is to use post cade in the extract, if&amp;nbsp;the result table is empty, execute endsas/abort abend etc.&lt;/P&gt;
&lt;P&gt;Third option is try to use the&amp;nbsp;Conditional Start/End transformations.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 14:29:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340427#M10103</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-03-13T14:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Stop DI job for blank data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340429#M10104</link>
      <description>&lt;P&gt;Just for reference, Aidan has asked related questions in&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Studio/Conditional-Start/m-p/339634" target="_blank"&gt;https://communities.sas.com/t5/SAS-Studio/Conditional-Start/m-p/339634&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Data-Management/Conditional-Start-amp-End/m-p/340000" target="_blank"&gt;https://communities.sas.com/t5/SAS-Data-Management/Conditional-Start-amp-End/m-p/340000&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally, I would dissect the job into its parts and have the scheduler handle the continuation conditions, controlled by return codes from the single jobs, or by the execution date as such.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 14:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340429#M10104</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-13T14:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Stop DI job for blank data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340445#M10106</link>
      <description>&lt;P&gt;I have tried a conditional start and end as per attached however it seems to just stop on conditional start&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 15:05:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340445#M10106</guid>
      <dc:creator>Aidan</dc:creator>
      <dc:date>2017-03-13T15:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Stop DI job for blank data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340446#M10107</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; I needed some more direction so had to post a new thread as it could be that I am approaching this incorrectly. Very new to writing on the fly SAS code so need more direction on this,</description>
      <pubDate>Mon, 13 Mar 2017 15:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340446#M10107</guid>
      <dc:creator>Aidan</dc:creator>
      <dc:date>2017-03-13T15:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Stop DI job for blank data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340449#M10108</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/91103"&gt;@Aidan&lt;/a&gt; wrote:&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; I needed some more direction so had to post a new thread as it could be that I am approaching this incorrectly. Very new to writing on the fly SAS code so need more direction on this,&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No problem. I just wanted to give everybody new to the topic a chance to see what was already talked about. Otherwise I'd have merged the threads into one, but I see an evolution of the theme(s) &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 15:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340449#M10108</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-13T15:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Stop DI job for blank data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340734#M10122</link>
      <description>&lt;P&gt;I have pre code in an extract node to check if data set is blank;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;dsid = open("&amp;amp;_Input");&lt;BR /&gt;call symputx('NOBS',attrn(dsid,'NOBS');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will only then e-mail the results if the data set is not blank as per below;&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA=work.W4JQ299&lt;BR /&gt;OUTFILE="\\test\my file.csv"&lt;BR /&gt;DBMS=CSV Replace;&lt;BR /&gt;PUTNAMES=YES;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;%macro email;&lt;BR /&gt;%if &amp;amp;NOBS &amp;lt;&amp;gt; 0 %then %do;&lt;BR /&gt;data _null_;&lt;BR /&gt;file sendit email&lt;BR /&gt;from="from"&lt;BR /&gt;to=("to")&lt;/P&gt;&lt;P&gt;subject="test"&lt;BR /&gt;attach=("\\test\my file.csv");&lt;BR /&gt;put "Hi all,";&lt;BR /&gt;put;&lt;BR /&gt;put "xxxxxxxxxxxxxx";&lt;BR /&gt;put;&lt;BR /&gt;put "Kind Regards,";&lt;BR /&gt;put "Aidan";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;%mend email;&lt;BR /&gt;%email;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The email code doenst seem to be working, any ideas?&lt;/P&gt;&lt;P&gt;I have removed the e-mail address and file location for security on here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Aidan&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 11:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340734#M10122</guid>
      <dc:creator>Aidan</dc:creator>
      <dc:date>2017-03-14T11:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Stop DI job for blank data set</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340813#M10129</link>
      <description>&lt;P&gt;Use ne instead of &amp;lt;&amp;gt; in the %if condition.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 15:04:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Stop-DI-job-for-blank-data-set/m-p/340813#M10129</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-14T15:04:40Z</dc:date>
    </item>
  </channel>
</rss>

