GKatReliable
Programmer
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
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