<?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: File semaforo in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300061#M63342</link>
    <description>&lt;P&gt;Thank you Kurt. So I translate in english my question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;Every day there is a scheduled job (in Unix machine) that export , in a specific location, a csv file that contains some information.&lt;/P&gt;&lt;P&gt;After the job produce that csv file, I need that the job produce also a semaphore file (the format is not important, but its name must contain the word OK) wich inform that the csv file is not empty.&lt;/P&gt;&lt;P&gt;How can I do this? What code I can write in the job? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2016 09:08:08 GMT</pubDate>
    <dc:creator>newbaw</dc:creator>
    <dc:date>2016-09-22T09:08:08Z</dc:date>
    <item>
      <title>File semaforo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300052#M63337</link>
      <description>&lt;P&gt;Buongiorno, vorrei creare un file semaforo a seguito dell'esecuzione di un job.&lt;/P&gt;&lt;P&gt;Questo job come risultato finale esporta un file csv giorno per giorno e&amp;nbsp;mi serve che un file semaforo(vuoto) verifichi che questo csv creato non sia vuoto.&lt;/P&gt;&lt;P&gt;C'è un modo? Grazie!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 08:21:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300052#M63337</guid>
      <dc:creator>newbaw</dc:creator>
      <dc:date>2016-09-22T08:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: File semaforo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300053#M63338</link>
      <description>&lt;P&gt;You might get more feedback if you posted your question in English.&lt;/P&gt;
&lt;P&gt;If do have an inkling that I might be able provide some help regarding semaphore files and their use, especially on UNIX platforms.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 08:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300053#M63338</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-22T08:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: File semaforo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300061#M63342</link>
      <description>&lt;P&gt;Thank you Kurt. So I translate in english my question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;Every day there is a scheduled job (in Unix machine) that export , in a specific location, a csv file that contains some information.&lt;/P&gt;&lt;P&gt;After the job produce that csv file, I need that the job produce also a semaphore file (the format is not important, but its name must contain the word OK) wich inform that the csv file is not empty.&lt;/P&gt;&lt;P&gt;How can I do this? What code I can write in the job? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 09:08:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300061#M63342</guid>
      <dc:creator>newbaw</dc:creator>
      <dc:date>2016-09-22T09:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: File semaforo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300063#M63343</link>
      <description>&lt;P&gt;Just do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
file "name_of_semaphore_file";
put 'OK';
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Sep 2016 09:17:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300063#M63343</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-22T09:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: File semaforo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300095#M63353</link>
      <description>&lt;P&gt;Thank you Kurt, but I think that&amp;nbsp;in this way the procedure only create a file with the 'OK' information, but there is no kind of control on the csv file that the job creates before the SEM file. How can I implement this control (that help the user to understand that the csv file is not empty)?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 12:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300095#M63353</guid>
      <dc:creator>newbaw</dc:creator>
      <dc:date>2016-09-22T12:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: File semaforo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300117#M63358</link>
      <description>&lt;P&gt;You can add number of observations exported to the CSV file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To answer the question - how to do it - please display your code for exporting:&lt;/P&gt;&lt;P&gt;is it by&lt;STRONG&gt; proc export&lt;/STRONG&gt; or by &lt;STRONG&gt;data step&lt;/STRONG&gt; or by &lt;STRONG&gt;sql ?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 14:16:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300117#M63358</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-22T14:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: File semaforo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300285#M63404</link>
      <description>&lt;P&gt;If you just want to check for a certain number of records processed in an export, you can do that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let nrecords=0;&lt;BR /&gt;* necessary, because the following data step will have no iteration at all if dataset indataset is empty;

data _null_;
file "outfile" /* options */;
set indataset /* options */ end=done;
put
/* variables */
;
if done then call symput('nrecords',strip(put(_n_,best.)));
run;

%macro write_sem;
%if "&amp;amp;nrecords" ne "0" %then %do;
data _null_;
file "semfile";
put 'OK';
run;
%end;
%mend;
%write_sem;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Sep 2016 05:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-semaforo/m-p/300285#M63404</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-23T05:33:41Z</dc:date>
    </item>
  </channel>
</rss>

