|
This may end up being an RPG question, but it starts with sftp in PASE. I have a scheduled download that runs a shell script which is just a batch sftp retrieve and delete. I put in a check in case there is an error (host not found, bad login, etc.) but apparently the shell script ends in error if there are no files to retrieve. In its current state, my program ends due to the error. Ordinarily, that's probably not a big deal. If, however, I have files that have been downloaded but not processed, they cannot get processed because the program ends after the sftp shell script.
If Qp2RunPase( SHELL_PGM
: *NULL
: *NULL
: 0
: 819
: argv
: envp ) <> 0;
// Error on sftp command
EscErrno(errno);
Else;
// Process files
endif;
This manifests as the following in my joblog:
From procedure . . . . . . : ESCERRNOStatement . . . . . . . . . : 3042100
Message . . . . : Text not available for message CPE0000 file QCPFMSG.
Recovery . . . : Add the message description (ADDMSGD) to the message file.
If this is an inquiry message and you need to reply to it, attempt to enter
a valid reply (if you know what it is for this message ID). Otherwise, enter
*N for the system default, or delete the message and the system default will
be sent.
It's not much of a useful error message. It's exactly the same if the error is "Permission denied (publickey,password)."
Is there a way to get a more meaningful error that I can then check in the program? It might be that expect is the answer, though I am not well versed in it. Either that or just ignore the error and hope for the best, but that doesn't sound great either.
--
Sean Porterfield
As an Amazon Associate we earn from qualifying purchases.
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.