<?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: FTP error handling in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254042#M40491</link>
    <description>Peter&lt;BR /&gt;&lt;BR /&gt;I had inconsistent results when fiddling with that. So decided on my workaround. Necessity is the mother of invention!&lt;BR /&gt;&lt;BR /&gt;Craig</description>
    <pubDate>Thu, 02 Sep 2010 12:53:02 GMT</pubDate>
    <dc:creator>Craig A</dc:creator>
    <dc:date>2010-09-02T12:53:02Z</dc:date>
    <item>
      <title>FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254029#M40478</link>
      <description>Hi, &lt;BR /&gt;Using OpenVMS V7.3-2 I have a batch program that creates and submits an ftp process to copy a file from server a to server b using tcpip. Occasionally, the ftp fails due to network error, access denied, etc. When there is an error like:  &lt;BR /&gt;%TCPIP-E-FTP_NETERR, I/O error on network device&lt;BR /&gt;-TCPIP-W-EAI_AGAIN, temporary failure&lt;BR /&gt;&lt;BR /&gt;The user wants to get emailed to notify him that the FTP has not completed successfully.My problem is that the status code that the FTP process returns to the parent program is the same whether the FTP is successful or not - This is the status code %X00030001. How can I code this so that the parent program will execute an error routine if there is an FTP error? &lt;BR /&gt;&lt;BR /&gt;Thanks !</description>
      <pubDate>Wed, 01 Sep 2010 09:57:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254029#M40478</guid>
      <dc:creator>Patricia Davey</dc:creator>
      <dc:date>2010-09-01T09:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254030#M40479</link>
      <description>Patricia&lt;BR /&gt;&lt;BR /&gt;One way would be to look for a successful string and then alert if it isn't present.&lt;BR /&gt;&lt;BR /&gt;If you do a PUT and the link breaks then the file will be left overhanging.&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;PUT PAT.DAT PAT.TMP&lt;BR /&gt;RENAME PAT.TMP PAT.DAT&lt;BR /&gt;&lt;BR /&gt;then check for the success string for a RENAME. For my local system the string is:&lt;BR /&gt;&lt;BR /&gt;250 File &lt;TEMP-FILE&gt; renamed to &lt;FILE&gt; &lt;BR /&gt;&lt;BR /&gt;So: &lt;BR /&gt;&lt;BR /&gt;$ SEARCH &lt;OUTPUT-FILE&gt; "250 File"," renamed to " /MATCH=AND&lt;BR /&gt;$ STATUS := '$STATUS'&lt;BR /&gt;$ IF STATUS .EQ. %X08D78053&lt;BR /&gt;$  THEN &lt;BR /&gt;$   SUCCESS = 0&lt;BR /&gt;$  ELSE&lt;BR /&gt;$   SUCCESS = 1&lt;BR /&gt;$ ENDIF&lt;BR /&gt;&lt;BR /&gt;Is a pretty simple way of determining whether the FTP was successful.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Craig&lt;/OUTPUT-FILE&gt;&lt;/FILE&gt;&lt;/TEMP-FILE&gt;</description>
      <pubDate>Wed, 01 Sep 2010 10:18:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254030#M40479</guid>
      <dc:creator>Craig A</dc:creator>
      <dc:date>2010-09-01T10:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254031#M40480</link>
      <description>Hi Craig, &lt;BR /&gt;&lt;BR /&gt;Thanks for your quick response. My understanding of your solution is that I search the batch log file for a successful FTP command like 250 CWD command successful or 226 Transfer complete and then write error code if the commands are not there. My problem is that the ftp process is within the batch command procedure and there is only one log file produced. &lt;BR /&gt;&lt;BR /&gt;For example in batch1.com here are the following commands:&lt;BR /&gt;$set on &lt;BR /&gt;$@pdftp_script.com server1 "lcd ud1:[temp], cd """""\dwfiles""""",mput *.*,dir" &lt;BR /&gt;$ftp_exit_status=$status&lt;BR /&gt;$if ftp_exit_status .eqs. ??? goto x&lt;BR /&gt;&lt;BR /&gt;(Last two lines I want to work but don't). Batch1.com writes to batch1.log so I cannot search it while it it being written to.</description>
      <pubDate>Wed, 01 Sep 2010 10:49:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254031#M40480</guid>
      <dc:creator>Patricia Davey</dc:creator>
      <dc:date>2010-09-01T10:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254032#M40481</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Another idea is to use a command file, say a.com, containing the ftp commands, the syntax ftp host /user /password, and test $status&lt;BR /&gt;&lt;BR /&gt;$ type a.com&lt;BR /&gt;put zzz.txt&lt;BR /&gt;quit&lt;BR /&gt;&lt;BR /&gt;and issue a &lt;BR /&gt;$ def/user sys$input a.com&lt;BR /&gt;$ ftp host/user=my_user/pass=my_pass&lt;BR /&gt;$ sh symb $status&lt;BR /&gt;&lt;BR /&gt;I get &lt;BR /&gt;  $STATUS == "%X17649AAA"&lt;BR /&gt;(which translates to&lt;BR /&gt;%TCPIP-E-FTP_LOGREJ, login request rejected&lt;BR /&gt;after a &lt;BR /&gt;$ set message sys$message:tcpip$msg.exe&lt;BR /&gt;$ exit %X17649AAA )&lt;BR /&gt;when I put a bad password, &lt;BR /&gt;and&lt;BR /&gt;$STATUS == %X17649A01&lt;BR /&gt;(which translates to&lt;BR /&gt;%TCPIP-S-FTP_EXIT, exit per user command )&lt;BR /&gt;with a succesfull FTP.&lt;BR /&gt;&lt;BR /&gt;So, if you don't get this last status, there is a problem.</description>
      <pubDate>Wed, 01 Sep 2010 11:01:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254032#M40481</guid>
      <dc:creator>labadie_1</dc:creator>
      <dc:date>2010-09-01T11:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254033#M40482</link>
      <description>You could try &lt;BR /&gt;&lt;BR /&gt;$@pdftp_script.com/out=tmpfile server1 "lcd ud1:[temp], cd """""\dwfiles""""",mput *.*,dir" &lt;BR /&gt;&lt;BR /&gt;And then you can search tmpfile for the string you want. If you want the log of the script in the total log, you can use &lt;BR /&gt;$type tempfile&lt;BR /&gt;&lt;BR /&gt;Don't forget to delete the tempfile after the search/type.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Fekko&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Sep 2010 11:06:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254033#M40482</guid>
      <dc:creator>Fekko Stubbe</dc:creator>
      <dc:date>2010-09-01T11:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254034#M40483</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Using OpenVMS V7.3-2 [...]&lt;BR /&gt;&lt;BR /&gt;      TCPIP SHOW VERSION&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I have a batch program that creates and&lt;BR /&gt;&amp;gt; submits an ftp process to copy a file from&lt;BR /&gt;&amp;gt; server a to server b using tcpip.&lt;BR /&gt;&lt;BR /&gt;Is this job running on "server a" or "server&lt;BR /&gt;b" or somewhere else?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] My problem is that the ftp process is&lt;BR /&gt;&amp;gt; within the batch command procedure [...]&lt;BR /&gt;&lt;BR /&gt;So change that?&lt;BR /&gt;&lt;BR /&gt;      HELP SPAWN</description>
      <pubDate>Wed, 01 Sep 2010 13:12:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254034#M40483</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-09-01T13:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254035#M40484</link>
      <description>Also, bear in mind that FTP can "hang". I got round this by spawninga subprocess for the actual FTP and then monitoring it using F$GETJPI (off the top of my head I think I checked Direct I/O - if it hadn't increased after 10 rounds of 30 seconds then consider the FTP job hung), kill it and re-schedule.&lt;BR /&gt;&lt;BR /&gt;Craig&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Sep 2010 13:50:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254035#M40484</guid>
      <dc:creator>Craig A</dc:creator>
      <dc:date>2010-09-01T13:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254036#M40485</link>
      <description>ftp is a festering pile of insecure ugly, and a construct and protocol best shoved out the airlock at your first available opportunity.&lt;BR /&gt;&lt;BR /&gt;Consider using the FTSO package on the OpenVMS Freeware.  It's free, it's a little buggy and slightly arcane, it'll likely never appear on OpenVMS I64, but it'll do what you want here, and way more.&lt;BR /&gt;&lt;BR /&gt;(Not to imply that FTSO is any more secure, nor any less ugly than ftp.)&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://decuslib.com/decus/freewarev70/ftso/" target="_blank"&gt;http://decuslib.com/decus/freewarev70/ftso/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;For DECnet, use the FTSV variant:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://decuslib.com/decus/freewarev70/ftsv/" target="_blank"&gt;http://decuslib.com/decus/freewarev70/ftsv/&lt;/A&gt;</description>
      <pubDate>Wed, 01 Sep 2010 15:13:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254036#M40485</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2010-09-01T15:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254037#M40486</link>
      <description>&amp;gt;ftp is a festering pile of insecure ugly, &amp;gt;and a construct and protocol best shoved &amp;gt;out the airlock at your first available &amp;gt;opportunity.&lt;BR /&gt;&lt;BR /&gt;Get off that fence, Hoff! :-)&lt;BR /&gt;&lt;BR /&gt;Craig</description>
      <pubDate>Wed, 01 Sep 2010 15:15:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254037#M40486</guid>
      <dc:creator>Craig A</dc:creator>
      <dc:date>2010-09-01T15:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254038#M40487</link>
      <description>Patricia,&lt;BR /&gt;&lt;BR /&gt;  Tracking errors can be tricky... first, a misconception:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Batch1.com writes to batch1.log so I &lt;BR /&gt;&amp;gt; cannot search it while it it being &lt;BR /&gt;&amp;gt; written to.&lt;BR /&gt;&lt;BR /&gt;  Yes you can! Log files are shared read, and you can control the disk flush interval. Use SET OUTPUT_RATE to set the flush timer to some known value. After some event you're interested, wait that long, then SEARCH the log file. &lt;BR /&gt;&lt;BR /&gt;$ PIPE TYPE/TAIL=&lt;NUMLINES&gt; BATCH1.LOG | SEARCH SYS$PIPE "whatever"&lt;BR /&gt;&lt;BR /&gt;(I posted some code recently that uses this idea. See last few posts in &lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1444100" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1444100&lt;/A&gt; ).&lt;BR /&gt;&lt;BR /&gt;But that's not the best way to keep track of errors. FTP should be returning $STATUS correctly, you just have to save it somewhere. &lt;BR /&gt;&lt;BR /&gt;Find the actual FTP command:&lt;BR /&gt;&lt;BR /&gt;$ FTP... whatever&lt;BR /&gt;$ ftpstatus=$STATUS&lt;BR /&gt;&lt;BR /&gt;if it's in a lower level procedure you can return it in a global symbol:&lt;BR /&gt;&lt;BR /&gt;$ ftpstatus==$STATUS&lt;BR /&gt;&lt;BR /&gt;or as the completion status for the procedure, like this:&lt;BR /&gt;&lt;BR /&gt;$ EXIT F$INTEGER(ftpstatus).OR.%X10000000&lt;BR /&gt;&lt;BR /&gt;(the OR will stop the EXIT command from displaying the error message).  &lt;BR /&gt;&lt;BR /&gt;If it's in a subprocess or pipe segment, return it via the job logical name table&lt;BR /&gt;&lt;BR /&gt;to "send":&lt;BR /&gt;&lt;BR /&gt;$ DEFINE/JOB/NOLOG FTPSTATUS "''ftpstatus'"&lt;BR /&gt;&lt;BR /&gt;to "receive":&lt;BR /&gt;&lt;BR /&gt;$ ftpstatus=F$INTEGER(F$TRNLNM("FTPSTATUS"))&lt;BR /&gt;&lt;BR /&gt;If you can't get a useable status from the FTP command, try using COPY/FTP instead.&lt;/NUMLINES&gt;</description>
      <pubDate>Wed, 01 Sep 2010 21:23:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254038#M40487</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-09-01T21:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254039#M40488</link>
      <description>Instead of using the generated ftp command file, use COPY/FTP and then you can check the status of individual operations.&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Sep 2010 12:20:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254039#M40488</guid>
      <dc:creator>RBrown_1</dc:creator>
      <dc:date>2010-09-02T12:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254040#M40489</link>
      <description>RBrown&lt;BR /&gt;&lt;BR /&gt;Be careful with COPY/FTP. &lt;BR /&gt;&lt;BR /&gt;If the link breaks mid-copy you could be left with a file fragmen on the remote server. Not helpful if there is an automated process on the remote node to process incoming files.&lt;BR /&gt;&lt;BR /&gt;Craig</description>
      <pubDate>Thu, 02 Sep 2010 12:34:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254040#M40489</guid>
      <dc:creator>Craig A</dc:creator>
      <dc:date>2010-09-02T12:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254041#M40490</link>
      <description>"Also, bear in mind that FTP can "hang"."&lt;BR /&gt;&lt;BR /&gt;Isn't this resolved by turning on FTP keepalive?&lt;BR /&gt;&lt;BR /&gt;$ def/sys/exec tcpip$ftp_keepalive 1</description>
      <pubDate>Thu, 02 Sep 2010 12:43:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254041#M40490</guid>
      <dc:creator>Peter Barkas</dc:creator>
      <dc:date>2010-09-02T12:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254042#M40491</link>
      <description>Peter&lt;BR /&gt;&lt;BR /&gt;I had inconsistent results when fiddling with that. So decided on my workaround. Necessity is the mother of invention!&lt;BR /&gt;&lt;BR /&gt;Craig</description>
      <pubDate>Thu, 02 Sep 2010 12:53:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254042#M40491</guid>
      <dc:creator>Craig A</dc:creator>
      <dc:date>2010-09-02T12:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254043#M40492</link>
      <description>Maybe an over simplification but how about using the On error command.  Right before the FTP you can use:&lt;BR /&gt;&lt;BR /&gt;$  on error then goto error_end:  &lt;BR /&gt;&lt;BR /&gt;Where Error_end is:&lt;BR /&gt;&lt;BR /&gt;$ error_end:&lt;BR /&gt;$ !&lt;BR /&gt;$ mail/subj="FTP Job Failed!" NL: "SMTP%user@company.com"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Sep 2010 14:16:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254043#M40492</guid>
      <dc:creator>jjinva</dc:creator>
      <dc:date>2010-09-02T14:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: FTP error handling</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254044#M40493</link>
      <description>Thanks to all of you for your suggestions. I have used a combination of Craig A's and Fekko Stubbe's responses to sort out my FTP issue and it is working very well.</description>
      <pubDate>Wed, 15 Sep 2010 10:53:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/ftp-error-handling/m-p/5254044#M40493</guid>
      <dc:creator>Patricia Davey</dc:creator>
      <dc:date>2010-09-15T10:53:46Z</dc:date>
    </item>
  </channel>
</rss>

