<?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: need to create a Control table using which the file should be loaded to table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/need-to-create-a-Control-table-using-which-the-file-should-be/m-p/337099#M76501</link>
    <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies for being unclear.&lt;/P&gt;&lt;P&gt;The Job runs daily, if thereare updates or if we have new file the external file needs to read into SAS and other reports need to be generated.&lt;/P&gt;&lt;P&gt;if there are no updates or do not have a new file then the process should exit and continue the other process.&lt;/P&gt;&lt;P&gt;%let &lt;FONT color="#800080" face="Courier New"&gt;dir1 = "/d:/sales/";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;data _Null_;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;x &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;dir1."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;x &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"find -maxdepth 1 -type f -mtime -7 -print &amp;gt; \D:\Santosh\Cmp.txt"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data _Null_;&lt;/P&gt;&lt;P&gt;Set filelist; *is the dataset consists the list of files ;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Call Symput('&lt;FONT face="Courier New"&gt;Lst_Rn_Dte'&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, fl_dte);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Today"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"day"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,today(),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;yymmn8.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "today ====&amp;gt;&amp;amp;today.";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; "Lst_Rn_Dte===&amp;gt;&amp;amp;Lst_Rn_Dte.";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;/*I need help on this i would like to execute this&amp;nbsp;only if we have a new file or an update on the file else exit this process and continue with processing for&amp;nbsp;other files&amp;nbsp;we need to read the external file in advance.*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%if&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysevalf&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&amp;amp;&lt;FONT face="Courier New"&gt;Lst_Rn_Dte&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) LE &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%SYSEVALF&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;today.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Note:"No File Avaialble.";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Mar 2017 18:47:50 GMT</pubDate>
    <dc:creator>santosh_pat69</dc:creator>
    <dc:date>2017-03-01T18:47:50Z</dc:date>
    <item>
      <title>need to create a Control table using which the file should be loaded to table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-create-a-Control-table-using-which-the-file-should-be/m-p/337060#M76488</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I trying to automate a process to read an external file.&lt;/P&gt;&lt;P&gt;I recieve a file on a monthly basis, 4-7 days before the start of the New month.&lt;/P&gt;&lt;P&gt;for E.g : the Sales file for the month for April 2017 will be recieved anywhere between 25-31 march.&lt;/P&gt;&lt;P&gt;currently we are reading the file by manualy changing the filenames, and not running this piece of code if we dont have any updates or untill we recieve the New sales file for the next month.&lt;/P&gt;&lt;P&gt;I am listing all the files from the directory and creating a temp datasets which stores all teh files details and from these files i amextracting the date (the filename looks like this : Mnthly_Sales_201702.csv) and sorting the dataset and creating a macro for the recent Sales files.&lt;/P&gt;&lt;P&gt;Now the problem is this file has to be loaded once every month if there are no updates.&lt;/P&gt;&lt;P&gt;Please help me on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 16:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-create-a-Control-table-using-which-the-file-should-be/m-p/337060#M76488</guid>
      <dc:creator>santosh_pat69</dc:creator>
      <dc:date>2017-03-01T16:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: need to create a Control table using which the file should be loaded to table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-create-a-Control-table-using-which-the-file-should-be/m-p/337074#M76492</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/38367"&gt;@santosh_pat69&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am listing all the files from the directory and creating a temp datasets which stores all teh files details and from these files i&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you can list all the files, you can use that to dynamically determine which dataset you need to process.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The steps appear correct, what exactly do you need help with, your question is unclear.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 17:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-create-a-Control-table-using-which-the-file-should-be/m-p/337074#M76492</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-01T17:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: need to create a Control table using which the file should be loaded to table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-to-create-a-Control-table-using-which-the-file-should-be/m-p/337099#M76501</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies for being unclear.&lt;/P&gt;&lt;P&gt;The Job runs daily, if thereare updates or if we have new file the external file needs to read into SAS and other reports need to be generated.&lt;/P&gt;&lt;P&gt;if there are no updates or do not have a new file then the process should exit and continue the other process.&lt;/P&gt;&lt;P&gt;%let &lt;FONT color="#800080" face="Courier New"&gt;dir1 = "/d:/sales/";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;data _Null_;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;x &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;dir1."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;x &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"find -maxdepth 1 -type f -mtime -7 -print &amp;gt; \D:\Santosh\Cmp.txt"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data _Null_;&lt;/P&gt;&lt;P&gt;Set filelist; *is the dataset consists the list of files ;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Call Symput('&lt;FONT face="Courier New"&gt;Lst_Rn_Dte'&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, fl_dte);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Today"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"day"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,today(),&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;yymmn8.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "today ====&amp;gt;&amp;amp;today.";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; "Lst_Rn_Dte===&amp;gt;&amp;amp;Lst_Rn_Dte.";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;/*I need help on this i would like to execute this&amp;nbsp;only if we have a new file or an update on the file else exit this process and continue with processing for&amp;nbsp;other files&amp;nbsp;we need to read the external file in advance.*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%if&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysevalf&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&amp;amp;&lt;FONT face="Courier New"&gt;Lst_Rn_Dte&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) LE &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%SYSEVALF&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;today.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Note:"No File Avaialble.";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 18:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-to-create-a-Control-table-using-which-the-file-should-be/m-p/337099#M76501</guid>
      <dc:creator>santosh_pat69</dc:creator>
      <dc:date>2017-03-01T18:47:50Z</dc:date>
    </item>
  </channel>
</rss>

