<?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 the program if an error connecting to an FTP ocurred in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171491#M32979</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the LS&amp;nbsp; or LIST option on the FTP infile to get a list of files in the folder&lt;/P&gt;&lt;P&gt;Only if it's there should you try to read it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; that option will be found on the FTP filename statement - probably not on INFILE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Aug 2014 07:07:23 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2014-08-22T07:07:23Z</dc:date>
    <item>
      <title>Stop the program if an error connecting to an FTP ocurred</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171490#M32978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to implement a line code for stop de program when the file does not exits in the ftp server but without sucess.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes I connect to an ftp for a file and it's no there anymore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sas write an Error in the log but continue processing, my intention is to stop the code after this error ocurred.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here were are an example of my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILENAME aaa ftp&amp;nbsp; "ftp path." user="&amp;amp;user." pass="&amp;amp;pass." debug&lt;/P&gt;&lt;P&gt; host='nameofthehost' rcmd='site rdw' cd='..';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test (compress = binary);&lt;/P&gt;&lt;P&gt;infile aaa missover lrecl=1420 recfm=F;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @1 wwww $EBCDIC8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @10 eeeee $EBCDIC39.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @51 rrrrrr $EBCDIC4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @56 ttttt $EBCDIC39.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if &amp;amp;syserr. ne 0 then abort;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve my purpose?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171490#M32978</guid>
      <dc:creator>SergioSanchez</dc:creator>
      <dc:date>2014-08-22T07:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the program if an error connecting to an FTP ocurred</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171491#M32979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the LS&amp;nbsp; or LIST option on the FTP infile to get a list of files in the folder&lt;/P&gt;&lt;P&gt;Only if it's there should you try to read it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; that option will be found on the FTP filename statement - probably not on INFILE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:07:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171491#M32979</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2014-08-22T07:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the program if an error connecting to an FTP ocurred</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171492#M32980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The option LIST is not working for me &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Invalid Reply received for the STOR command..'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the line of code&lt;STRONG&gt; if &amp;amp;syserr. ne 0 then abort; it doesn't anyting because the code continue to run &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171492#M32980</guid>
      <dc:creator>SergioSanchez</dc:creator>
      <dc:date>2014-08-22T07:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the program if an error connecting to an FTP ocurred</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171493#M32981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps your FTP server does not understand command LIST.&lt;/P&gt;&lt;P&gt;Have you tried LS?&lt;/P&gt;&lt;P&gt;Please show the code and log&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:35:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171493#M32981</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2014-08-22T07:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the program if an error connecting to an FTP ocurred</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171494#M32982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have no access to these options, In any case my intention is not to see the files that are in the server but it stop the program for prevent to run without observations due to not to download the data from the server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 08:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171494#M32982</guid>
      <dc:creator>SergioSanchez</dc:creator>
      <dc:date>2014-08-22T08:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Stop the program if an error connecting to an FTP ocurred</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171495#M32983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/67401/HTML/default/viewer.htm#n1nzmsupywf45qn1m6j1eczg1cb4.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/67401/HTML/default/viewer.htm#n1nzmsupywf45qn1m6j1eczg1cb4.htm"&gt;SAS(R) 9.4 Language Reference: Concepts, Third Edition&lt;/A&gt;&amp;nbsp; Error processing is a long long story.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &amp;amp;syserr and &amp;amp;sasrc are macro-variables these are set after a proc/datstep processing.&lt;BR /&gt;Builing logic on macro-variables is macroprocessing in this case to be implemented after the datastep processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are differences in the error-condition follow up.&lt;/P&gt;&lt;P&gt;In interactive mode it can proceed a lot, in batch mode it is more often halting. When you are using interactive mode expect the need for manual intervention.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;You can delete the dataset test and after the datastep has run verify the number of obs aside other things (macro) to do follow up as you like.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 08:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stop-the-program-if-an-error-connecting-to-an-FTP-ocurred/m-p/171495#M32983</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-08-22T08:16:25Z</dc:date>
    </item>
  </channel>
</rss>

