× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Phil,

Do you have the PTF installed that fixes error handling?

You're right that QUSRJOBI (which, IMHO, you should not be using.. you should be using QShell!) won't return failure... but that's because your script doesn't propagate the error to the caller.

But the fact that the RENAME runs even if the PUT failed implies to me that you're missing the PTF. Without that PTF, you're going nowhere fast.

For v5r3, the PTF is SI25208
For v5r4, the PTF is SI25209





On 8/20/2010 1:09 PM, ssc1478 wrote:
I'm struggling with error handling with SFTP and QP2SHELL.

I created a generic shell script file that accepts parms:

#!/bin/sh
fromfile=$1
tofile=$2
user=$3
tgtsys=$4
totmpfile=$5
errlvl=$6
sftp $errlvl $user@$tgtsys<< EOT
put $fromfile $totmpfile
rename $totmpfile $tofile
quit
EOT

If the put fails, it will still do the rename. And retrieving the
result out using the QUSRJOBI api always returns success.

So I am thinking that it will not work unless I execute sftp instead
of sh. I want to try that, but am wondering if I can pass parms to an
sftp file:

put $fromfile $totmpfile
rename $totmpfile $tofile

Or do I need to either have a script file for each sftp that I will
do, or create the file dynamically each time?

Just trying to understand the rules!
Thanks,

Phil


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.