Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ZModem "Transfer Status: Aborted"

Status
Not open for further replies.

zelims

Programmer
Apr 22, 2003
1
US
I have a automated process that daily starts Procomm and then uses an Aspect script, using the Zmodem protocol to transfer a file elsewhere. Unfortunately the process during that transfer isn't always reliable and I'm hoping someone can help me out as I am very new to Procomm scripting.

While the Zmodem is tranferring the file, the Zmodem UI is displayed with the progress bar and other stats. One of these items says "Transfer Status:" and on occasion it suddenly adds "Aborted" after that in the UI and then jumps back to Procomm where the terminal window displays the string: "500 [232] CDataBuffer::Read Success, Buffer Empty". Then the remote machine sends the original prompt that indicated the system ready for Zmodem to start transfer -- this is always displayed after a transfer is stopped.

My script does this:

while $XFERSTATUS == 1
yield
endwhile

if $XFERSTATUS == 2
;return successful transfer string
else
;return error string

Even if I get that odd "CDataBuffer..." string and the Zmodem states the transfer was aborted, my script always seems to return a success string ($XFERSTATUS == 2). Therefore the remote machine only gets part of the file transferred with an error, but I get success messages from the automated process.

The remote party sees this information:

"Message: FAILURE CODE 034
Description: The Connection was cancelled before conpletion by the remote site. CONNECT:Mailbox received a Function
Management Header (FMH) with codes set to Abort Data Set
(ADS), so the batch is treated as an incomplete batch."

If I have the process re-send that exact file, it eventually transfers just fine, so there isn't anything in the file itself that is causing this.

Do you have any suggestions as to how to capture the "Transfer Aborted" status from the Zmodem and the string "CDataBuffer..." in the Procomm terminal display with my script so I can program this into the script as an error?
 
$XFERSTATUS resets itself after a transfer is complete and its value has been accessed, so this is most likely what is happening with your script. Here is a sample framework that I use when transferring files. I assign the value of $XFERSTATUS to an intermediate value and check that variable's value instead. You might try using this in your script and see if that works better.

proc main
integer iStatus

getfile ZMODEM
iStatus = $XFERSTATUS
while iStatus == 1
iStatus = $XFERSTATUS
endwhile
if iStatus == 2
;Transfer successful, continue with script execution
elseif iStatus == 3
;Transfer failed, perform error handling
endif
endproc

aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top