<?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: create a txtfile into a folder in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/create-a-txtfile-into-a-folder/m-p/727720#M28218</link>
    <description>&lt;P&gt;i make a script where it can see if there is mistakes in the log-file&lt;/P&gt;
&lt;P&gt;The email is always the same - so if there is an error in the script I get the same mail.&lt;/P&gt;
&lt;P&gt;If all files a developed without erros I also get the same mail that everything is good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I do the datastep as you say?&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2021 10:28:54 GMT</pubDate>
    <dc:creator>mmea</dc:creator>
    <dc:date>2021-03-19T10:28:54Z</dc:date>
    <item>
      <title>create a txtfile into a folder</title>
      <link>https://communities.sas.com/t5/New-SAS-User/create-a-txtfile-into-a-folder/m-p/727400#M28196</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Evry day I send some files into a folder&lt;/P&gt;
&lt;P&gt;these files are created in this macro - when the files are sent I get an email that says files has been send - if it fails I get an email that says error.&lt;/P&gt;
&lt;P&gt;I want to create a text file with some text that has to be sent to the folder with the files IF the files has no errors. How can I add that in the do and else function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro leverance(region);
/*tabel 1*/
here I will have code for the datasets
/*tabel 2*/
here I will have code for the datasets
/*tabel 3*/
here I will have code for the datasets
/*tabel 4*/
here I will have code for the datasets
/*tabel 5*/
here I will have code for the datasets
/*tabel 1*/

here I will have code for the datasets

%do i=1 %to 5;

proc export data=tabel&amp;amp;i. replace
  outfile="&amp;amp;out_folder.\&amp;amp;data._TAB&amp;amp;i._&amp;amp;YYYYMMDD..csv"
  dbms=dlm
;
delimiter=';';
quit;

%end;
%mend;


%macro dummy_macro();
%if &amp;amp;nobs ne 4 %then %do; 

filename mymail email from='test@test.org' to=&amp;amp;mailto.
         subject='ERROR - the data has not been send'

%end;
%else %do;

%leverance(A);
%leverance(B);
%leverance(C);
%leverance(D);
%leverance(E);

filename mymail email from='test@test.test' to=&amp;amp;mailto.
         subject='The files has been succesfully send';

%end;
%mend;

%dummy_macro();
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Mar 2021 13:40:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/create-a-txtfile-into-a-folder/m-p/727400#M28196</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2021-03-18T13:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: create a txtfile into a folder</title>
      <link>https://communities.sas.com/t5/New-SAS-User/create-a-txtfile-into-a-folder/m-p/727422#M28197</link>
      <description>&lt;P&gt;How and where do you determine "the files has no errors"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is an example of the text that gets sent? If the message does not change then likely the easiest would be to have a SAS data set with a single variable containing the text and then Export that the same as you are currently doing.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 14:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/create-a-txtfile-into-a-folder/m-p/727422#M28197</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-18T14:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: create a txtfile into a folder</title>
      <link>https://communities.sas.com/t5/New-SAS-User/create-a-txtfile-into-a-folder/m-p/727720#M28218</link>
      <description>&lt;P&gt;i make a script where it can see if there is mistakes in the log-file&lt;/P&gt;
&lt;P&gt;The email is always the same - so if there is an error in the script I get the same mail.&lt;/P&gt;
&lt;P&gt;If all files a developed without erros I also get the same mail that everything is good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I do the datastep as you say?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 10:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/create-a-txtfile-into-a-folder/m-p/727720#M28218</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2021-03-19T10:28:54Z</dc:date>
    </item>
  </channel>
</rss>

