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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing for failed file transfer, failed

Status
Not open for further replies.

GKatReliable

Programmer
Jul 2, 2002
45
0
0
US
We send a file to our bank by modem using PCPlus, and at the end of my script I move the file to an archive folder and add the date and time to the filename. Whenever the file transfer fails, the archive portion of the script still runs and it takes a bit of doing to put the file back to where it gets originally modemed from, for a re-try.

I spent a good amount of time researching this forum and the Aspect help screens, and added some error detection to my script. The user tried it for the first time today.

What happened was, the transfer worked, but then the script just sat there running with nothing happening. The bank at the other end terminated the connection like they should have. The bank confirms they got the file. The original file at our end did not get "archived" (the RENAME step in the script segment below). What my code does is test for everything that can go wrong and bail if it does. If nothing goes wrong, all the code should just flow through. But it didn't.

Thank you for considering this teensy problem.
Regards,
Glenn Koproske

This is the applicable portion of what I did to this script:

waitfor "Please start file transfer"
SENDFILE ZMODEM mdatafilespec
;Test initiation of file transfer attempt
if SUCCESS
ixferflag = $XFERSTATUS
WHILE ixferflag = 1
YIELD
; Read current transfer status
ixferflag = $XFERSTATUS
ENDWHILE
if ixferflag = 3
ERRORMSG "File transfer failed. This program will terminate."
PWEXIT
endif
else
; Sendfile failed
ERRORMSG "File transfer did not start. This program will terminate."
PWEXIT
endif
WAITFOR "\USER\UNITN01]cmd"
TRANSMIT "$$LOGOFF^M"
RENAME mdatafilespec msavefilespec
 
You need to use == when comparing values, otherwise a single equals sign will assign the value on the right to the variable on the left. These are the lines you need to change:

WHILE ixferflag = 1
if ixferflag = 3

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top